Skip to content

Commit

Permalink
feat: create canonical link
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jun 2, 2023
1 parent e18d52e commit 6099f3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default defineNuxtConfig({
public: {
NODE_ENV: process.env.NODE_ENV,

APP_DOMAIN: process.env.APP_DOMAIN,

API_URL: process.env.API_URL,

PROXY_URL: process.env.PROXY_URL,
Expand Down
12 changes: 11 additions & 1 deletion pages/posts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,23 @@
return description
})
},
// TODO: Canonical
// Necessary so images can be loaded from other domains
{
name: 'referrer',
content: 'no-referrer'
}
],
link: [
{
rel: 'canonical',
href: computed(() => {
const rawRoute = generatePostsRoute(selectedBooru.value.domain, selectedPage.value, selectedTags.value)
return 'https://' + config.public.APP_DOMAIN + router.resolve(rawRoute).href
})
}
]
})
</script>
Expand Down

0 comments on commit 6099f3a

Please sign in to comment.