Remove wrapping to create wider nav entries

Fixes #9.
This commit is contained in:
Florine W. Dekker 2021-04-13 20:04:48 +02:00
parent e5c92d3d95
commit 5043c92d56
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
2 changed files with 3 additions and 2 deletions

View File

@ -83,4 +83,5 @@
.nav ul li ul li {
min-width: 7em;
width: 100%;
white-space: nowrap;
}

View File

@ -86,7 +86,7 @@ export const nav = function (highlightPath = "") {
const unpackEntry = function (entry, path = "/", highlightPath = "") {
const shouldHighlight = highlightPath.startsWith(`${path + entry.name}/`);
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)
return `<li class="${shouldHighlight ? "currentPage" : ""}"><a href="${entry.link}">${formattedName}</a></li>`;
@ -96,7 +96,7 @@ const unpackEntry = function (entry, path = "/", highlightPath = "") {
return "" +
`<li class="${shouldHighlight ? "currentPage" : ""}">` +
`<a href="${entry.link}">${formattedName}&nbsp;${arrow}</a>` +
`<a href="${entry.link}">${formattedName} ${arrow}</a>` +
`<ul>${entry.entries.map(it => unpackEntry(it, `${path + entry.name}/`, highlightPath)).join("")}</ul>` +
`</li>`;
};