Dominik Milacher 0dc24c4db7
Some checks failed
Build and deploy updated apps / Build & deploy (push) Failing after 50s
Extend ux layer and overhaul panoramablick-saalbach.at
2025-11-21 21:17:52 +01: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}))
}