cleanup active class generation

main
Jonathan Dahan 12 months ago
parent 98f79db819
commit 5ebbfe6819

@ -1,5 +1,4 @@
#!/bin/sh
# sets the 'active' class on an item if the url matches the directory
urlpath=$(dirname "$ZS_URL")
test "$1" = $urlpath && printf "active" || true
if [ "$(dirname "$ZS_URL")" = $1 ]; then printf ' class=active' ''; fi

@ -1,15 +1,19 @@
<link href=/style.css rel=stylesheet />
<header>
<nav>
<a href=jonathan.is>jonathan.is</a>
<a href=/>jonathan.is</a>
<menu>
<li class="{{ active writing }}"><a href=/writing >/writing</a>
<li class="{{ active speaking }}"><a href=/speaking >/speaking</a>
<li class="{{ active coding }}"><a href=/coding >/coding</a>
<li class="{{ active making }}"><a href=/making >/making</a>
<li class="{{ active working }}"><a href=/working >/working</a>
<li class="{{ active living }}"><a href=/living >/living</a>
<li {{ active writing }}><a href=/writing>/writing</a>
<li {{ active speaking }}><a href=/speaking>/speaking</a>
<li {{ active coding }}><a href=/coding>/coding</a>
<li {{ active making }}><a href=/making>/making</a>
<li {{ active working }}><a href=/working>/working</a>
<li {{ active living }}><a href=/living>/living</a>
</menu>
</nav>
</header>
<main>
{{ content }}
</main>

Loading…
Cancel
Save