f753261345
Changing the theme using toggle does not require reloading the entire page using self-linking
15 lines
385 B
HTML
15 lines
385 B
HTML
<header>
|
|
<div class="main">
|
|
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
|
</div>
|
|
<nav>
|
|
{{ range .Site.Menus.main }}
|
|
<a href="{{ .URL }}">{{ .Name }}</a>
|
|
{{ end }}
|
|
{{ if eq .Site.Params.mode "toggle" -}}
|
|
| <span id="dark-mode-toggle" onclick="toggleTheme()"></span>
|
|
<script src="{{ .Site.BaseURL }}js/themetoggle.js"></script>
|
|
{{ end }}
|
|
</nav>
|
|
</header>
|