article and relayout
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user