From bb95955b75627f3b9a42e49287a48e2484122b6e Mon Sep 17 00:00:00 2001 From: Surmon Date: Sun, 30 Jul 2023 06:59:02 +0700 Subject: [PATCH] feat: improve seo meta --- src/pages/naivebayes.vue | 4 +++- src/pages/readme-md.vue | 4 +++- src/pages/videojs-player.vue | 4 +++- src/pages/vue-awesome-swiper.vue | 4 +++- src/pages/vue-codemirror.vue | 4 +++- src/pages/vue-drag-zone.vue | 4 +++- src/pages/vue-quill-editor.vue | 4 +++- src/pages/vue-touch-ripple.vue | 4 +++- src/transforms/meta.ts | 4 +--- 9 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/pages/naivebayes.vue b/src/pages/naivebayes.vue index 18b6fc11..d048ee5f 100644 --- a/src/pages/naivebayes.vue +++ b/src/pages/naivebayes.vue @@ -22,8 +22,10 @@ title: getMetaTitle(repository), keywords: getMetaKeywords(repository).join(','), description: getMetaDescription(repository), + ogUrl: getPageURL(route), ogImage: getGitHubOpenGraphImageURL(repository), - ogUrl: getPageURL(route) + ogImageWidth: 1200, + ogImageHeight: 600 }) ) diff --git a/src/pages/readme-md.vue b/src/pages/readme-md.vue index a498dd62..a01aa7b4 100644 --- a/src/pages/readme-md.vue +++ b/src/pages/readme-md.vue @@ -12,8 +12,10 @@ title: getMetaTitle(repository), keywords: getMetaKeywords(repository).join(','), description: getMetaDescription(repository), + ogUrl: getPageURL(route), ogImage: getGitHubOpenGraphImageURL(repository), - ogUrl: getPageURL(route) + ogImageWidth: 1200, + ogImageHeight: 600 }) ) diff --git a/src/pages/videojs-player.vue b/src/pages/videojs-player.vue index 3940181f..ede21897 100755 --- a/src/pages/videojs-player.vue +++ b/src/pages/videojs-player.vue @@ -19,8 +19,10 @@ title: getMetaTitle(repository), keywords: getMetaKeywords(repository).join(','), description: getMetaDescription(repository), + ogUrl: getPageURL(route), ogImage: getGitHubOpenGraphImageURL(repository), - ogUrl: getPageURL(route) + ogImageWidth: 1200, + ogImageHeight: 600 }) ) diff --git a/src/pages/vue-awesome-swiper.vue b/src/pages/vue-awesome-swiper.vue index 098ead3f..51d050fb 100644 --- a/src/pages/vue-awesome-swiper.vue +++ b/src/pages/vue-awesome-swiper.vue @@ -18,8 +18,10 @@ title: getMetaTitle(repository), keywords: [getMetaKeywords(repository), `How to use Swiper on vue3?`].join(','), description: getMetaDescription(repository), + ogUrl: getPageURL(route), ogImage: getGitHubOpenGraphImageURL(repository), - ogUrl: getPageURL(route) + ogImageWidth: 1200, + ogImageHeight: 600 }) ) diff --git a/src/pages/vue-codemirror.vue b/src/pages/vue-codemirror.vue index aa66063a..afb2ca43 100755 --- a/src/pages/vue-codemirror.vue +++ b/src/pages/vue-codemirror.vue @@ -23,8 +23,10 @@ title: getMetaTitle(repository), keywords: getMetaKeywords(repository).join(','), description: getMetaDescription(repository), + ogUrl: getPageURL(route), ogImage: getGitHubOpenGraphImageURL(repository), - ogUrl: getPageURL(route) + ogImageWidth: 1200, + ogImageHeight: 600 }) ) diff --git a/src/pages/vue-drag-zone.vue b/src/pages/vue-drag-zone.vue index b9efd4c7..1f46ae78 100755 --- a/src/pages/vue-drag-zone.vue +++ b/src/pages/vue-drag-zone.vue @@ -12,8 +12,10 @@ title: getMetaTitle(repository), keywords: getMetaKeywords(repository).join(','), description: getMetaDescription(repository), + ogUrl: getPageURL(route), ogImage: getGitHubOpenGraphImageURL(repository), - ogUrl: getPageURL(route) + ogImageWidth: 1200, + ogImageHeight: 600 }) ) diff --git a/src/pages/vue-quill-editor.vue b/src/pages/vue-quill-editor.vue index 5e89f78b..d9e77125 100755 --- a/src/pages/vue-quill-editor.vue +++ b/src/pages/vue-quill-editor.vue @@ -12,8 +12,10 @@ title: getMetaTitle(repository), keywords: getMetaKeywords(repository).join(','), description: getMetaDescription(repository), + ogUrl: getPageURL(route), ogImage: getGitHubOpenGraphImageURL(repository), - ogUrl: getPageURL(route) + ogImageWidth: 1200, + ogImageHeight: 600 }) ) diff --git a/src/pages/vue-touch-ripple.vue b/src/pages/vue-touch-ripple.vue index ebf95bd7..76ce3d30 100644 --- a/src/pages/vue-touch-ripple.vue +++ b/src/pages/vue-touch-ripple.vue @@ -18,8 +18,10 @@ title: getMetaTitle(repository), keywords: getMetaKeywords(repository).join(','), description: getMetaDescription(repository), + ogUrl: getPageURL(route), ogImage: getGitHubOpenGraphImageURL(repository), - ogUrl: getPageURL(route) + ogImageWidth: 1200, + ogImageHeight: 600 }) ) diff --git a/src/transforms/meta.ts b/src/transforms/meta.ts index b818b43e..30c1fee5 100644 --- a/src/transforms/meta.ts +++ b/src/transforms/meta.ts @@ -38,8 +38,6 @@ export const normalizeSeoMetaObject = (i: SeoMetaObject): Parameters i.ogDescription ?? i.description ?? APP_META.description, ogUrl: () => i.ogUrl ?? '', ogImage: () => i.ogImage ?? '', - ogImageAlt: () => i.ogImageAlt ?? i.ogDescription ?? i.description ?? APP_META.description, - ogImageWidth: () => i.ogImageWidth ?? (i.ogImage ? '' : '1200'), - ogImageHeight: () => i.ogImageHeight ?? (i.ogImage ? '' : '600') + ogImageAlt: () => i.ogImageAlt ?? i.ogDescription ?? i.description ?? APP_META.description } }