add page menu and tie it into jump links to be useful and efficient for nav

This commit is contained in:
KemoNine 2023-03-21 10:01:02 -04:00
parent 70aa1b57a1
commit 35553fcb08
4 changed files with 28 additions and 2 deletions

View file

@ -23,7 +23,7 @@
{{ if $.Scratch.Get "has_related" }}
&nbsp;|&nbsp;<a class="back_to_top" href="#related">Back to related pages</a>
{{ end }}
&nbsp;|&nbsp;<a class="back_to_top" href="#page_menu">Back to page menu</a>
&nbsp;|&nbsp;<a class="back_to_top" href="#nav_menu">Back to site menu</a>
{{ with .Site.Params.footer }}

View file

@ -1,9 +1,29 @@
<div class="article-meta">
{{ if .Params.toc }}
<a id="page_menu" />
{{ if .Page.Params.toc }}
<a class="back_to_top" href="#top">Jump to ToC</a>
{{ else }}
<a class="back_to_top" href="#top">Jump to content</a>
{{ end }}
{{ with .Page.Params.categories }}
&nbsp;|&nbsp;<a class="back_to_top" href="#categories">Jump to categories</a>
{{ end }}
{{ with .Page.Params.tags }}
&nbsp;|&nbsp;<a class="back_to_top" href="#tags">Jump to tags</a>
{{ end }}
{{ range first 1 (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
{{ $.Scratch.Set "has_related" true }}
{{ end }}
{{ if $.Scratch.Get "has_related" }}
&nbsp;|&nbsp;<a class="back_to_top" href="#related">Jump to related pages</a>
{{ end }}
<h1><span class="title">{{ .Title | markdownify }}</span></h1>
{{ with .Params.author }}
<h3 class="author">By:

View file

@ -1,5 +1,8 @@
{{ if .Page.Params.toc }}
<a class="back_to_top" href="#top">Back to ToC</a>
&nbsp;|&nbsp;
{{ else }}
<a class="back_to_top" href="#top">Back to top</a>
&nbsp;|&nbsp;
{{ end }}
<a class="back_to_top" href="#page_menu">Back to page menu</a>

View file

@ -1,6 +1,9 @@
{{ if .Page.Params.toc }}
<a class="back_to_top" href="#top">Back to ToC</a>
&nbsp;|&nbsp;
{{ else }}
<a class="back_to_top" href="#top">Back to top</a>
&nbsp;|&nbsp;
{{ end }}
<a class="back_to_top" href="#page_menu">Back to page menu</a>
<hr />