Highlight logo if on main page
This commit is contained in:
parent
2e33b8d762
commit
a208f13f4e
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@fwdekker/template",
|
||||
"version": "3.3.6",
|
||||
"version": "3.3.7",
|
||||
"description": "The base template for pages on fwdekker.com.",
|
||||
"author": "Florine W. Dekker",
|
||||
"license": "MIT",
|
||||
|
|
|
@ -86,7 +86,11 @@ function nav(highlightPath?: string, cb?: (json: any) => void): HTMLElement {
|
|||
const checkbox = stringToHtml(`<input id="fwd-nav-hamburger-checkbox" type="checkbox" hidden />`);
|
||||
nav.appendChild(checkbox);
|
||||
|
||||
const base = stringToHtml(`<ul><li><a id="logo" href="https://fwdekker.com/">FWDekker</a></span></li></ul>`);
|
||||
const base = stringToHtml(
|
||||
`<ul><li ${highlightPath === "/" ? `class="fwd-nav-highlighted" aria-current="page"` : ""}>` +
|
||||
`<a id="logo" href="https://fwdekker.com/">FWDekker</a>` +
|
||||
`</li></ul>`
|
||||
);
|
||||
fetch("https://fwdekker.com/api/nav/")
|
||||
.then(it => it.json())
|
||||
.then(json => {
|
||||
|
|
Loading…
Reference in New Issue