Dominik Milacher 73083ded58
Some checks failed
Build and deploy updated apps / Build & deploy (push) Failing after 1m7s
Overhaul content management
2025-10-22 19:31:38 +02:00

26 lines
625 B
TypeScript

export function useSeoLinking() {
const config = useContentConfig()
const locales = config.locale?.list.map(l => l.code) ?? []
const {locale} = useContentInjected()
const route = useRoute()
const base = 'https://panoramablick-saalbach.at'
const links = computed(() => {
const links = []
for (const l of locales) {
const path = '/' + l + route.path.slice(3)
links.push({rel: 'alternate', hreflang: l, href: base + path})
if (l === locale.value) {
links.push({rel: 'canonical', href: base + path})
}
}
return links
})
useHead(() => ({link: links.value}))
}