hugo-theme-contentful/layouts/partials/header.html
Gabriel Arazas 052e7703ab Improve the accessibility of the theme
Along with some improved formatting of some modules. The changelog
should be enough to make what changes have occured.
2020-10-24 03:13:14 +08:00

15 lines
819 B
HTML

<nav aria-label="Primary navigation">
<a class="site__title" href="{{ "" | absLangURL }}">{{ $.Site.Title }}</a>
<div class="site__links">
|
{{ range $.Site.Menus.main -}}
<a href="{{ .URL | absLangURL }}">{{ .Name }}</a> |
{{ end }}
</div>
<button class="site__theme-btn" aria-label="theme-toggle" onclick="const theme = window.localStorage.getItem('theme') == 'dark' ? 'light' : 'dark'; window.localStorage.setItem('theme', theme); document.documentElement.dataset.theme = theme">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12-5.373-12-12-12-12 5.373-12 12zm2 0c0-5.514 4.486-10 10-10v20c-5.514 0-10-4.486-10-10z"></path>
</svg>
</button>
</nav>