Skip to content

Commit

Permalink
add description and canonical
Browse files Browse the repository at this point in the history
  • Loading branch information
khanzadimahdi committed May 18, 2024
1 parent fdb7f07 commit 0551fd0
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 3 deletions.
11 changes: 11 additions & 0 deletions frontend/pages/articles/[uuid].vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,18 @@

<script setup>
const {uuid} = useRoute().params;
const resolveFileUrl = useFilesUrlResolver().resolve
const data = await $fetch(useApiUrlResolver().resolve(`api/articles/${uuid}`))
useHead({
title: data.title,
meta: [
{ name: 'description', content: data.excerpt },
],
link: [
{ rel: 'canonical', href: `/articles/${uuid}` }
]
})
</script>
12 changes: 11 additions & 1 deletion frontend/pages/articles/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@
</template>

<script setup>
useHead({
title: `مقاله ها`,
meta: [
{ name: 'description', content: `مقاله ها` },
],
link: [
{ rel: 'canonical', href: '/articles' }
]
})
const url = useApiUrlResolver().resolve("api/articles")
const { pending, data } = await useFetch(url, {
pick: ['items', 'pagination']
});
})
</script>
11 changes: 10 additions & 1 deletion frontend/pages/auth/forgot-password.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
</template>

<script setup>
useHead({
title: 'بازیابی کلمه عبور',
meta: [
{ name: 'description', content: 'بازیابی کلمه عبور' },
],
link: [
{ rel: 'canonical', href: `/auth/forgot-password` }
]
})
// reflects form parameters
const params = reactive({
identity: null,
Expand Down Expand Up @@ -58,7 +68,6 @@ async function forgotPassword() {
}
</script>


<style scoped>
#login-cover {
background-image: url('/img/login-bg.jpg');
Expand Down
10 changes: 10 additions & 0 deletions frontend/pages/auth/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
</template>

<script setup>
useHead({
title: 'ورود به پنل کاربری',
meta: [
{ name: 'description', content: 'ورود به پنل کاربری' },
],
link: [
{ rel: 'canonical', href: `/auth/login` }
]
})
// reflects form parameters
const params = reactive({
identity: null,
Expand Down
10 changes: 10 additions & 0 deletions frontend/pages/auth/reset-password.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
</template>

<script setup>
useHead({
title: 'تغییر کلمه عبور',
meta: [
{ name: 'description', content: 'تغییر کلمه عبور' },
],
link: [
{ rel: 'canonical', href: `/auth/reset-password` }
]
})
// reflects form parameters
const params = reactive({
token: null,
Expand Down
10 changes: 10 additions & 0 deletions frontend/pages/hashtags/[hashtag].vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
<script setup>
const { hashtag } = useRoute().params;
useHead({
title: `هشتک|${hashtag}`,
meta: [
{ name: 'description', content: `هشتک|${hashtag}` },
],
link: [
{ rel: 'canonical', href: '/hashtag' }
]
})
const url = useApiUrlResolver().resolve(`api/hashtags/${hashtag}`)
const { pending, data } = await useFetch(url, {
pick: ['items', 'pagination']
Expand Down
8 changes: 7 additions & 1 deletion frontend/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@

<script setup>
useHead({
title: "صفحه اصلی"
title: "صفحه اصلی",
meta: [
{ name: 'description', content: 'طرح‌چه' },
],
link: [
{ rel: 'canonical', href: '/' }
]
})
const { data, pending, error } = await useAsyncData(
Expand Down

0 comments on commit 0551fd0

Please sign in to comment.