diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-12 23:58:15 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-12 23:58:29 +0200 |
| commit | 02915fb955416ebd05aee35ccdad327d9c4fab0a (patch) | |
| tree | b2faf9bef7d21a9a7a488db9758fa9711da200ac /layouts | |
| parent | ec74b924339ebcf9724d02d89fde405de2dc6847 (diff) | |
| download | gohugo-theme-ed-02915fb955416ebd05aee35ccdad327d9c4fab0a.tar.gz | |
Implement sidebar-toc
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/baseof.html | 1 | ||||
| -rw-r--r-- | layouts/partials/sidebar-toc.html | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 1a777b3..9d9e70b 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -7,6 +7,7 @@ <header class="masthead"> <div class="container"> <h3 class="masthead-title"> + {{/* TODO: Translate titlle */}} <a href="{{ site.Home.RelPermalink }}" title="Home">{{ site.Title }}</a> <br><small>{{ site.Params.tagline }}</small> </h3> diff --git a/layouts/partials/sidebar-toc.html b/layouts/partials/sidebar-toc.html index e69de29..18ca0e6 100644 --- a/layouts/partials/sidebar-toc.html +++ b/layouts/partials/sidebar-toc.html @@ -0,0 +1,27 @@ +{{/* 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>{{ .Title }}</p> + </div> + + <nav class="sidebar-nav"> + {{/* TODO: Translate links */}} + <a class="sidebar-nav-item" href="{{ site.Home.RelPermalink }}">Home</a> + <a class="sidebar-nav-item" href="#" data-proofer-ignore>Return to Top</a> + + {{ range $item := .Params.toc }} + <!-- {% if page.url == node.url %} active{% endif %} --> + <a class="sidebar-nav-item sidebar-nav-item-toc" href="#{{ . | anchorize }}">{{ . }}</a> + {{ end }} + </nav> + + <div class="sidebar-item"> + <p>Edited by {{ .Params.editor }}, {{ now.Format "2006" }}.</p> + <p> + Built with <a href="https://minicomp.github.io/ed/" target="_blank" rel="noopener noreferrer">Ed.</a> Distributed under an MIT license. + </p> + </div> +</aside> |
