parent
e5c92d3d95
commit
5043c92d56
|
@ -83,4 +83,5 @@
|
||||||
.nav ul li ul li {
|
.nav ul li ul li {
|
||||||
min-width: 7em;
|
min-width: 7em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ export const nav = function (highlightPath = "") {
|
||||||
const unpackEntry = function (entry, path = "/", highlightPath = "") {
|
const unpackEntry = function (entry, path = "/", highlightPath = "") {
|
||||||
const shouldHighlight = highlightPath.startsWith(`${path + entry.name}/`);
|
const shouldHighlight = highlightPath.startsWith(`${path + entry.name}/`);
|
||||||
const isExternalLink = !entry.link.startsWith("https://fwdekker.com/") && entry.link !== "#";
|
const isExternalLink = !entry.link.startsWith("https://fwdekker.com/") && entry.link !== "#";
|
||||||
const formattedName = (isExternalLink ? "⎋ " : "") + entry.name;
|
const formattedName = (isExternalLink ? "⎋ " : "") + entry.name;
|
||||||
|
|
||||||
if (entry.entries.length === 0)
|
if (entry.entries.length === 0)
|
||||||
return `<li class="${shouldHighlight ? "currentPage" : ""}"><a href="${entry.link}">${formattedName}</a></li>`;
|
return `<li class="${shouldHighlight ? "currentPage" : ""}"><a href="${entry.link}">${formattedName}</a></li>`;
|
||||||
|
@ -96,7 +96,7 @@ const unpackEntry = function (entry, path = "/", highlightPath = "") {
|
||||||
|
|
||||||
return "" +
|
return "" +
|
||||||
`<li class="${shouldHighlight ? "currentPage" : ""}">` +
|
`<li class="${shouldHighlight ? "currentPage" : ""}">` +
|
||||||
`<a href="${entry.link}">${formattedName} ${arrow}</a>` +
|
`<a href="${entry.link}">${formattedName} ${arrow}</a>` +
|
||||||
`<ul>${entry.entries.map(it => unpackEntry(it, `${path + entry.name}/`, highlightPath)).join("")}</ul>` +
|
`<ul>${entry.entries.map(it => unpackEntry(it, `${path + entry.name}/`, highlightPath)).join("")}</ul>` +
|
||||||
`</li>`;
|
`</li>`;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue