feat(website): bilingual i18n (English default, Danish at /da) + SEO

Add @nuxtjs/i18n: English is the default locale (no prefix), Danish lives
under /da (prefix_except_default). Both server-rendered and indexed with
hreflang alternates + per-locale canonical (useLocaleHead in app.vue).
First-visit browser language is auto-detected and remembered in the
i18n_redirected cookie (redirectOn root).

- Keep the hand-authored COPY object; useLang/useCopy now read the i18n
  locale; useLocalizeHref/useLangToggle added. Every internal link is
  localized so navigation stays in-locale.
- Clear segmented EN|DA language switcher (active segment filled) replacing
  the ambiguous "en · da" pill.
- SEO: useSeoMeta defaults are locale-aware; og:image switches per locale
  (English / Danish share card); favicon links; robots.txt + sitemap.xml;
  env-aware siteUrl/baseUrl (localhost in dev, dezky.eu in prod).
- Update the cookie policy (dezky-lang -> i18n_redirected).
- Gate the Traefik wss:443 HMR behind DEZKY_TRAEFIK so localhost dev/DevTools
  connect over plain ws (fixes the DevTools disconnect loop).
This commit is contained in:
Ronni Baslund
2026-06-06 20:46:26 +02:00
parent 3f0298e011
commit 7bee161ac1
24 changed files with 1812 additions and 107 deletions
+44
View File
@@ -1,3 +1,47 @@
<script setup lang="ts">
// Site-wide SEO. @nuxtjs/i18n (useLocaleHead) owns <html lang>/dir, hreflang
// alternates, canonical and og:url / og:locale per locale. useSeoMeta adds the
// content cards (title/description/image, Twitter), locale-aware. Pages still
// override their own title/description via useHead.
const { locale } = useI18n()
const i18nHead = useLocaleHead()
const site = (useRuntimeConfig().public.siteUrl as string).replace(/\/$/, '')
const seo = computed(() => locale.value === 'da'
? {
title: 'dezky — din digitale arbejdsplads, hostet i EU',
desc: 'Mail, filer, video, chat og login — samlet i én suite, hostet i EU og bygget på åbne standarder.',
img: `${site}/og-image-da.png`,
}
: {
title: 'dezky — your digital workplace, hosted in the EU',
desc: 'Mail, files, video, chat and sign-in — one suite, hosted in the EU and built on open standards.',
img: `${site}/og-image.png`,
})
// html lang/dir + hreflang + canonical + og:url/og:locale from the i18n module.
useHead(() => ({
htmlAttrs: i18nHead.value.htmlAttrs,
link: i18nHead.value.link,
meta: i18nHead.value.meta,
}))
useSeoMeta({
description: () => seo.value.desc,
ogType: 'website',
ogSiteName: 'dezky',
ogTitle: () => seo.value.title,
ogDescription: () => seo.value.desc,
ogImage: () => [{ url: seo.value.img, width: 1200, height: 630, type: 'image/png' }],
twitterCard: 'summary_large_image',
twitterTitle: () => seo.value.title,
twitterDescription: () => seo.value.desc,
twitterImage: () => seo.value.img,
})
useHead({ meta: [{ name: 'robots', content: 'index, follow' }] })
</script>
<template>
<NuxtLayout>
<NuxtPage />