article and relayout

This commit is contained in:
seb
2026-07-19 19:39:07 +02:00
parent f012f27bf9
commit af9e072427
12 changed files with 878 additions and 209 deletions

View File

@@ -10,7 +10,15 @@ export default function SectionLayout({ sectionPath }) {
const subPath = item.segment ? `${sectionPath}/${item.segment}` : sectionPath;
return pathname === subPath || pathname === `${subPath}/`;
});
const pageTitle = activeSub && subNav ? activeSub.label : title;
const knownSegments = new Set((subNav ?? []).map((item) => item.segment).filter(Boolean));
const rest = pathname.slice(sectionPath.length).replace(/^\//, '').split('/')[0];
const detailSku =
sectionPath === '/artikel' && rest && !knownSegments.has(rest)
? decodeURIComponent(rest)
: null;
const pageTitle = detailSku ?? (activeSub && subNav ? activeSub.label : title);
return (
<PageLayout title={pageTitle} subNav={subNav} basePath={sectionPath}>