0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 05:32:41 +00:00

Add identifier to ToC pages in header nav

This commit is contained in:
G.Ambatte
2025-01-09 12:53:52 +13:00
parent a9823d39e2
commit a72f47df46

View File

@@ -16,9 +16,13 @@ const HeaderNav = React.forwardRef(({}, pagesRef)=>{
elements.forEach((el)=>{ elements.forEach((el)=>{
if(el.className.match(/\bpage\b/)) { if(el.className.match(/\bpage\b/)) {
let text = `Page ${el.id.slice(1)}`;
if(el.querySelector('.toc')){
text += ' - Contents';
};
navList.push({ navList.push({
depth : 0, depth : 0,
text : `Page ${el.id.slice(1)}`, text : text,
link : el.id, link : el.id,
className : 'pageLink' className : 'pageLink'
}); });