Breaking changes
Some checks failed
Build and Deploy Container / build_and_deploy (push) Failing after 33s

This commit is contained in:
Clemens Hering
2025-11-10 21:10:31 +01:00
parent e9a52787ce
commit 9fd3df83e7
16 changed files with 259 additions and 218 deletions

View File

@@ -4,13 +4,15 @@ const { title = "Valtrix Struktur schafft Wert", description = "Cloud, Secur
// Language & routing helpers
const pathname = Astro.url.pathname;
const isEn = pathname.startsWith('/en');
const isDe = pathname.startsWith('/de');
const lang = isEn ? 'en' : 'de';
const prefix = isEn ? '/en' : '';
const stripEn = (p) => p.replace(/^\/en(?=\/|$)/, '');
const altHref = isEn ? (stripEn(pathname) || '/') : ('/en' + (pathname === '/' ? '' : pathname));
// Default to /de for links so navigation always points to language-prefixed routes
const prefix = isEn ? '/en' : '/de';
const stripLang = (p) => p.replace(/^\/(?:en|de)(?=\/|$)/, '');
const altHref = isEn ? ('/de' + (stripLang(pathname) || '/')) : ('/en' + (stripLang(pathname) || '/'));
// Canonical/alternate URLs (use provided path when present for og/link tags)
const canonicalPath = path || pathname;
const deHref = stripEn(canonicalPath) || '/';
const deHref = canonicalPath.startsWith('/de') ? canonicalPath : ('/de' + (canonicalPath === '/' ? '' : canonicalPath));
const enHref = canonicalPath.startsWith('/en') ? canonicalPath : ('/en' + (canonicalPath === '/' ? '' : canonicalPath));
// Nav labels per language
const labels = isEn ? {