Skip to content

Commit

Permalink
Merge pull request #7575 from roiLeo/fix/galleryItem/seo
Browse files Browse the repository at this point in the history
🔧 GalleryItem SEO
  • Loading branch information
roiLeo authored Oct 10, 2023
2 parents 3680155 + dfddd39 commit c82b3e4
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions components/gallery/GalleryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,27 +266,28 @@ onMounted(() => {
const { isUnlockable, unlockLink } = useUnlockable(collection)
const title = computed(() => nftMetadata.value?.name || '')
const meta = computed(() => {
return [
{
title: title.value,
description: convertMarkdownToText(nftMetadata.value?.description),
image: generateNftImage(
title.value,
formatBalanceEmptyOnZero(nft.value?.price as string),
sanitizeIpfsUrl(nftImage.value || ''),
nftMimeType.value,
),
mime: nftMimeType.value,
url: route.path,
video: sanitizeIpfsUrl(nftAnimation.value || ''),
},
]
const seoDescription = computed(
() => convertMarkdownToText(nftMetadata.value?.description) || '',
)
const seoCard = computed(() => {
if (nft.value) {
return generateNftImage(
title.value,
formatBalanceEmptyOnZero(nft.value?.price as string),
sanitizeIpfsUrl(nftImage.value || ''),
nftMimeType.value,
)
}
})
useHead({
useSeoMeta({
title,
meta,
description: seoDescription,
ogTitle: title,
ogDescription: seoDescription,
ogImage: seoCard,
twitterImage: seoCard,
twitterCard: 'summary_large_image',
})
</script>
Expand Down

0 comments on commit c82b3e4

Please sign in to comment.