Skip to content

Commit

Permalink
feat(posts): create SEO content
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed May 23, 2023
1 parent a928a17 commit 0f558ef
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions pages/posts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,50 @@
await router.push(generatePostsRoute(selectedBooru.value.domain, undefined, selectedTags.value))
}
useHead({
title: computed(() => {
let title = ''
if (selectedTags.value.length > 0) {
title += ` ${tagArrayToTitle(selectedTags.value)}`
}
title += ` hentai from ${selectedBooru.value.domain}`
title = title.trim()
title = capitalize(title)
return title
}),
meta: [
{
name: 'description',
content: computed(() => {
let description = 'Stream and download images, GIFs and videos'
if (selectedTags.value.length > 0) {
description += ` featuring ${tagArrayToTitle(selectedTags.value)}`
}
description += ' hentai'
if (selectedBooru.value.domain) {
description += ` from the ${selectedBooru.value.domain} website`
}
description += '. For free!'
return description
})
},
// Necessary so images can be loaded from other domains
{
name: 'referrer',
content: 'no-referrer'
}
]
})
</script>

<template>
Expand Down

0 comments on commit 0f558ef

Please sign in to comment.