diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-04-24 09:33:37 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-04-24 09:33:37 +0200 |
| commit | fbcb1c002a30382b7e999be6e3bd6065e80cfaca (patch) | |
| tree | c132a94c3072ff201efb29dbb0af1205f525d444 /layouts | |
| parent | b056f13dc9322a55288433a167841de592124937 (diff) | |
| download | gohugo-theme-ed-fbcb1c002a30382b7e999be6e3bd6065e80cfaca.tar.gz | |
Amend sidebar
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/sidebar.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index e69de29..c4a3220 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -0,0 +1,33 @@ +{{- /* Target for toggling the sidebar `.sidebar-checkbox` is for regular styles, `#sidebar-checkbox` for behavior. */ -}} +<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox"> + +<!-- Toggleable sidebar --> +<aside class="sidebar" id="sidebar"> + <div class="sidebar-item"> + <p>{{- .Site.Params.Description -}}</p> + </div> + + <nav class="sidebar-nav"> + <a class="sidebar-nav-item{{- if .IsHome }} active{{ end -}}" href="{{ .Site.BaseURL }}">Home</a> + + {{- $current := . }} + {{- /* TODO: Render items dynamically */}} + {{- range .Site.Menus.nav }} + {{- $active := or ($current.IsMenuCurrent "nav" .) ($current.HasMenuCurrent "nav" .) }} + {{- $active = or $active (eq .Name $current.Title) }} + <a class="sidebar-nav-item {{ if $active }}active{{ end }}" href="{{ .URL }}"> + {{- $text := print .Name | safeHTML -}} + {{- $text -}} + </a> + {{- end -}} + {{/* TODO: Add hypothesis support */}} + <a class="sidebar-nav-item" href="{{ .Site.Params.github_url }}" target="_blank">GitHub project</a> + </nav> + + <div class="sidebar-item"> + <p> + Built with <a href="https://github.com/sergeyklay/gohugo-theme-ed" target="_blank">Ed.</a> + Distributed under an MIT license. + </p> + </div> +</aside> |
