Browse Source

Remove wrapping to create wider nav entries

Fixes #9.
master v0.0.26
F.W. Dekker 8 months ago
parent
commit
5043c92d56
Signed by: FWDekker GPG Key ID: B1B567AF58D6EE0F
  1. 1
      src/main/css/nav.css
  2. 4
      src/main/js/Template.js

1
src/main/css/nav.css

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

4
src/main/js/Template.js

@ -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>`;
};

Loading…
Cancel
Save