Breaking changes
Some checks failed
Build and Deploy Container / build_and_deploy (push) Failing after 33s
Some checks failed
Build and Deploy Container / build_and_deploy (push) Failing after 33s
This commit is contained in:
@@ -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 ? {
|
||||
|
||||
Reference in New Issue
Block a user