Commit d2cf7aee authored by Pooya Parsa's avatar Pooya Parsa

feat: dynamic canonical link

parent 89854ad0
......@@ -22,10 +22,14 @@ import { feeds } from "~/common/api"
export default {
head() {
const host = process.server
? this.$ssrContext.req.headers.host
: window.location.host
return {
link: [
// We use $route.path since we don't use query parameters
{ rel: "canonical", href: `https://hn.nuxtjs.org${this.$route.path}` }
{ rel: "canonical", href: `https://${host}${this.$route.path}` }
]
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment