Tweak tweak tweak tweak

This commit is contained in:
Halfdan 2022-11-15 18:17:19 +01:00
parent 8af9ecc791
commit da27da80a7
4 changed files with 16 additions and 20 deletions

View file

@ -191,6 +191,7 @@ aside header a img {
body {
flex-direction : column;
border : 0;
line-height : 2rem;
}
aside {
@ -208,11 +209,6 @@ aside header a img {
margin : calc(var(--base-grid) / 2) var(--base-grid);
}
aside header a {
width : 35%;
max-width : 35%;
}
aside nav {
display : none;
}

View file

@ -5,6 +5,7 @@
<aside>
<header>
<a href="index.html"><img src="{{ printf "/static/img/logo_%s.svg" .Site.Language.Lang | absURL }}" alt="data coop logo" width="240" height="140"></a>
<div class="nav-toggle" id="nav-toggle-header">
<span id="nav-toggle-a"></span>
<span id="nav-toggle-b"></span>
@ -19,20 +20,20 @@
</article>
</main>
<script>
var menu = document.getElementById("nav-toggle-header")
var nav = document.getElementsByTagName('nav')[0]
var menu = document.getElementById("nav-toggle-header");
var nav = document.getElementsByTagName('nav')[0];
function toggleMenu() {
if ( menu.classList.contains("display") ) {
menu.classList.remove("display")
nav.classList.remove("display")
menu.classList.remove("display");
nav.classList.remove("display");
} else {
menu.classList.add("display")
nav.classList.add("display")
menu.classList.add("display");
nav.classList.add("display");
}
}
menu.addEventListener( "click", toggleMenu )
menu.addEventListener("click", toggleMenu);
</script>
</body>
</html>

View file

@ -3,5 +3,4 @@
<h1>{{ .Title | markdownify }}</h1>
{{ .Content }}
{{- end -}}

View file

@ -1,16 +1,16 @@
<nav>
<ol>
{{ range .Site.Menus.nav }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
{{ $currentPage := . }}
{{ range .Site.Menus.nav }}
<li><a href="{{ .URL }}" class="{{ if $currentPage.IsMenuCurrent "nav" . }}active{{ end }}">{{ .Name }}</a></li>
{{ end }}
</ol>
<footer>
<ol>
{{ range $.Site.Home.AllTranslations }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
{{ range $.Site.Home.AllTranslations }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ol>
</footer>
</nav>