Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update dynamic meta data #395

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion packages/ui/components/DataFeedDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,41 @@ watch(
},
{ deep: true },
)

useHead({
title: `${normalizedFeed.value?.name ?? ''} Witnet Data Feed on ${normalizedFeed.value?.networkName ?? 'selected network'}`,
meta: [
{
hid: 'title',
name: 'title',
content: `${normalizedFeed.value?.name ?? ''} Witnet Data Feed on ${normalizedFeed.value?.networkName ?? 'selected network'}`,
},
{
hid: 'description',
name: 'description',
content: `Last result of ${normalizedFeed.value?.name ?? ''} Witnet Data Feed on ${normalizedFeed.value?.networkName ?? 'selected network'} is ${lastResultValue.value} at ${lastResultDate.value}`,
},
{
hid: 'twitter:title',
name: 'twitter:title',
content: `${normalizedFeed.value?.name ?? ''} Witnet Data Feed on ${normalizedFeed.value?.networkName ?? 'selected network'}`,
},
{
hid: 'twitter:description',
name: 'twitter:description',
content: `Last result of ${normalizedFeed.value?.name ?? ''} Witnet Data Feed on ${normalizedFeed.value?.networkName ?? 'selected network'} is ${lastResultValue.value} at ${lastResultDate.value}`,
},
{
hid: 'og:title',
property: 'og:title',
content: `${normalizedFeed.value?.name ?? ''} Witnet Data Feed on ${normalizedFeed.value?.networkName ?? 'selected network'}`,
},
{
hid: 'og:description',
property: 'og:description',
content: `Last result of ${normalizedFeed.value?.name ?? ''} Witnet Data Feed on ${normalizedFeed.value?.networkName ?? 'selected network'} is ${lastResultValue.value} at ${lastResultDate.value}`,
},
],
})
useSeoMeta({
ogTitle: () =>
`${normalizedFeed.value?.name ?? ''} Witnet Data Feed on ${normalizedFeed.value?.networkName ?? 'selected network'}`,
Expand Down
25 changes: 12 additions & 13 deletions packages/ui/components/EcosystemNetworkList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ import { generateNavOptions } from '../utils/generateNavOptions'
const store = useStore()
const route = useRoute()
const router = useRouter()

useServerSeoMeta({
ogTitle: () => `Witnet Data Feeds on ${currentEcosystemSeoFormat.value}`,
title: () => `Witnet Data Feeds on ${currentEcosystemSeoFormat.value}`,
description: () =>
`Explore the list of decentralized data feeds on ${currentEcosystemSeoFormat.value}, using the Witnet oracle network`,
ogDescription: () =>
`Explore the list of decentralized data feeds on ${currentEcosystemSeoFormat.value}, using the Witnet oracle network`,
twitterTitle: () => `Witnet Data Feeds on ${currentEcosystemSeoFormat.value}`,
twitterDescription: () =>
`Explore the list of decentralized data feeds on ${currentEcosystemSeoFormat.value}, using the Witnet oracle network`,
})
const currentEcosystem = ref(route.params.network.toString())
const currentEcosystemSeoFormat = ref(currentEcosystem.value.toUpperCase())
const selectedEcosystem = computed(() => store.selectedEcosystem)
Expand Down Expand Up @@ -134,7 +122,7 @@ useHead({
{
hid: 'og:title',
property: 'og:title',
content: 'Data Feeds Explorer | Witnet',
content: `Witnet Data Feeds on ${currentEcosystemSeoFormat.value}`,
},
{
hid: 'og:description',
Expand All @@ -158,6 +146,17 @@ useHead({
},
],
})
useSeoMeta({
ogTitle: () => `Witnet Data Feeds on ${currentEcosystemSeoFormat.value}`,
title: () => `Witnet Data Feeds on ${currentEcosystemSeoFormat.value}`,
description: () =>
`Explore the list of decentralized data feeds on ${currentEcosystemSeoFormat.value}, using the Witnet oracle network`,
ogDescription: () =>
`Explore the list of decentralized data feeds on ${currentEcosystemSeoFormat.value}, using the Witnet oracle network`,
twitterTitle: () => `Witnet Data Feeds on ${currentEcosystemSeoFormat.value}`,
twitterDescription: () =>
`Explore the list of decentralized data feeds on ${currentEcosystemSeoFormat.value}, using the Witnet oracle network`,
})
</script>

<style lang="scss" scoped>
Expand Down
24 changes: 12 additions & 12 deletions packages/ui/components/LandingPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@
import { generateSelectOptions } from '../utils/generateSelectOptions'
const store = useStore()

useServerSeoMeta({
ogTitle: () => 'Data Feeds Explorer | Witnet',
title: () => 'Data Feeds Explorer | Witnet',
description: () =>
'Explore the list of decentralized data feeds to connect your smart contracts to real world events, using the Witnet oracle network',
ogDescription: () =>
'Explore the list of decentralized data feeds to connect your smart contracts to real world events, using the Witnet oracle network',
twitterTitle: () => 'Data Feeds Explorer | Witnet',
twitterDescription: () =>
'Explore the list of decentralized data feeds to connect your smart contracts to real world events, using the Witnet oracle network',
})

const totalFeeds = computed(() => store.totalFeeds)
const networks = computed(() => store.networks)
const supportedChains = computed(() => {
Expand Down Expand Up @@ -61,6 +49,18 @@ onMounted(async () => {
store.updateSelectedNetwork({ networks: [] })
await store.fetchEcosystems()
})

useSeoMeta({
ogTitle: () => 'Data Feeds Explorer | Witnet',
title: () => 'Data Feeds Explorer | Witnet',
description: () =>
'Explore the list of decentralized data feeds to connect your smart contracts to real world events, using the Witnet oracle network',
ogDescription: () =>
'Explore the list of decentralized data feeds to connect your smart contracts to real world events, using the Witnet oracle network',
twitterTitle: () => 'Data Feeds Explorer | Witnet',
twitterDescription: () =>
'Explore the list of decentralized data feeds to connect your smart contracts to real world events, using the Witnet oracle network',
})
</script>

<style lang="scss" scoped>
Expand Down
Loading