Skip to content

Commit

Permalink
feat(App & Blogs): 🔍 Improved SEO
Browse files Browse the repository at this point in the history
More SEO Meta at slug page / ogLocale / meta tag
  • Loading branch information
bKoZii committed Sep 25, 2024
1 parent 7dbde96 commit 2ae41ce
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ useHead({
}
]
})
useSeoMeta({
ogLocale: 'th_TH'
})
</script>

<style>
Expand Down
5 changes: 5 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export default defineNuxtConfig({
layoutTransition: { name: 'layout', mode: 'out-in' },
head: {
titleTemplate: '%s - Konkamon Sion',
meta: [
{ name: 'author', content: 'Konkamon Sion' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'charset', content: 'utf-8' }
],
htmlAttrs: {
lang: 'th'
},
Expand Down
15 changes: 14 additions & 1 deletion pages/blog/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,20 @@ useSeoMeta({
description: blogSlug.value?.subtitle,
ogDescription: blogSlug.value?.subtitle,
ogImage: blogSlug.value?.mainImage.data.attributes.url,
ogUrl: `https://konkamon.live/blog/${blogSlug.value?.slug}`
ogImageType: 'image/png',
ogImageAlt: `รูปภาพปกประจำโพสต์ ${blogSlug.value?.title}`,
ogImageSecureUrl: blogSlug.value?.mainImage.data.attributes.url,
ogUrl: `https://konkamon.live/blog/${blogSlug.value?.slug}`,
publisher: 'Konkamon Sion',
robots: {
index: true
},
ogType: 'article',
articlePublishedTime: blogSlug.value?.publishedAt,
articleModifiedTime: blogSlug.value?.updatedAt,
articleTag: blogSlug.value?.categories.data.map((category) => category.attributes.name),
articleAuthor: ['Konkamon Sion'],
author: 'Konkamon Sion'
})
definePageMeta({
Expand Down

0 comments on commit 2ae41ce

Please sign in to comment.