Skip to content

Commit

Permalink
fix: update og-image description for pages (#117)
Browse files Browse the repository at this point in the history
# Description

The ogImage was set on `app.vue` which overrides all other ogImage
configurations on child pages.
- Removed ogImage config in app.vue and set it up on /content/index.vue
  • Loading branch information
itsacoyote authored Jun 10, 2024
1 parent 27cf566 commit a87df9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 1 addition & 7 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ useHead({
useSeoMeta({
titleTemplate: `%s - ${seo?.siteName}`,
ogSiteName: seo?.siteName,
ogUrl: 'https://docs.zksync.io/',
ogUrl: 'https://docs.zksync.io',
ogImageAlt: 'Hyperscaling Ethereum with ZK tech.',
ogDescription:
'zkSync Docs bring you all information you need about our protocol, APIs, SDKs, ZK Stack, and ZK chains. Start with our guides and tutorials, or go deep into our architecture and protocol specification.',
Expand All @@ -36,12 +36,6 @@ useSeoMeta({
twitterCreator: '@zkSyncDevs',
twitterImageAlt: 'Hyperscaling Ethereum with ZK tech.',
});
defineOgImage({
component: 'OgImageZK',
title: seo?.siteName,
description: 'Access detailed guides, references and resources that will help you build with zkSync Era.',
});
</script>

<template>
Expand Down
8 changes: 8 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<script setup lang="ts">
const { data: page } = await useAsyncData('index', () => queryContent('/').findOne());
const { seo } = useAppConfig();
useSeoMeta({
titleTemplate: '',
title: page.value?.title,
ogTitle: page.value?.title,
description: page.value?.description,
ogDescription: page.value?.description,
});
defineOgImage({
component: 'OgImageZK',
title: seo?.siteName,
description: 'Access detailed guides, references and resources that will help you build with zkSync Era.',
});
</script>

<template>
Expand Down

0 comments on commit a87df9d

Please sign in to comment.