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:
@@ -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'
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user