Correctly highlight level 1 empty navs
This commit is contained in:
parent
543f65675d
commit
e4e5193b70
|
@ -87,7 +87,7 @@ const unpackEntry = function (entry, path = "/", highlightPath = "") {
|
|||
const shouldHighlight = highlightPath.startsWith(`${path + entry.name}/`);
|
||||
|
||||
if (entry.entries.length === 0)
|
||||
return `<li><a href="${entry.link}" class="${shouldHighlight ? "currentPage" : ""}">${entry.name}</a></li>`;
|
||||
return `<li class="${shouldHighlight ? "currentPage" : ""}"><a href="${entry.link}">${entry.name}</a></li>`;
|
||||
|
||||
const depth = path.split("/").length - 2; // -1 because count parts, then another -1 because of leading `/`
|
||||
const arrow = depth === 0 ? "▾" : "▸";
|
||||
|
|
Loading…
Reference in New Issue