summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-05-28 17:48:18 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-05-28 17:48:18 +0200
commit3ffae027ef6f7a6c3b18d72a4ea65f0a15ddcfe6 (patch)
tree670fda27b04bd2fde09884240d7a915d89e65003 /layouts
parentaa6f524fa6cb5b4cee0b64d35138ac0318bf7fd8 (diff)
downloadgohugo-theme-ed-3ffae027ef6f7a6c3b18d72a4ea65f0a15ddcfe6.tar.gz
Provide ability to render feeds menu
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/sidebar.html41
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" . }}