diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-28 17:48:18 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-28 17:48:18 +0200 |
| commit | 3ffae027ef6f7a6c3b18d72a4ea65f0a15ddcfe6 (patch) | |
| tree | 670fda27b04bd2fde09884240d7a915d89e65003 /layouts/partials/sidebar.html | |
| parent | aa6f524fa6cb5b4cee0b64d35138ac0318bf7fd8 (diff) | |
| download | gohugo-theme-ed-3ffae027ef6f7a6c3b18d72a4ea65f0a15ddcfe6.tar.gz | |
Provide ability to render feeds menu
Diffstat (limited to 'layouts/partials/sidebar.html')
| -rw-r--r-- | layouts/partials/sidebar.html | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index e6e4bd3..e3da92d 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -1,24 +1,39 @@ -{{/* Target for toggling the sidebar `.sidebar-checkbox` is for regular styles, `#sidebar-checkbox` for behavior. */}} +{{/* 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 --> +{{/* Toggleable sidebar */}} <aside class="sidebar" id="sidebar"> <div class="sidebar-item"> - <p>{{- site.Params.Description -}}</p> + <p>{{ site.Params.Description }}</p> </div> <nav class="sidebar-nav"> - {{- $current := . }} - {{- range site.Menus.main }} - {{- $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) }} - {{- $active = or $active (eq .URL $current.RelPermalink) }} - {{- $active = or $active (eq .Name $current.Title) }} - <a class="sidebar-nav-item{{ if $active }} active{{ end }}" href="{{ .URL }}" {{- if eq .Params.external true }} target="_blank" rel="noopener noreferrer"{{ end }}> - {{- $text := print .Name | safeHTML -}} - {{- $text -}} - </a> - {{- end -}} + {{ $current := . }} + {{ range site.Menus.main }} + {{ $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) }} + {{ $active = or $active (eq .URL $current.RelPermalink) }} + {{ $active = or $active (eq .Name $current.Title) }} + <a class="sidebar-nav-item{{ if $active }} active{{ end }}" + href="{{ .URL }}" + id="menu-main-{{ .Identifier }}" + {{- if eq .Params.external true }} target="_blank" rel="noopener noreferrer"{{ end }}> + {{- print .Name | safeHTML -}} + </a> + {{ end }} + {{/* TODO: Add hypothesis support */}} + + {{ with site.Menus.feeds }} + <div class="sidebar-nav-item"> + {{ range $i, $ := site.Menus.feeds }} + {{ if $i }}<span aria-hidden="true">|</span>{{ end }} + <a href="{{ .URL }}" id="menu-feeds-{{ .Identifier }}"> + {{ print .Name | safeHTML }} + </a> + {{ end }} + </div> + {{ end }} </nav> {{ partial "footer" . }} |
