#nav: fix arrow nav for unlisted pages #184 #185

This commit is contained in:
Sören Weber 2022-02-18 02:13:35 +01:00
parent 0363998519
commit a856400626
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
7 changed files with 13 additions and 16 deletions

View file

@ -27,7 +27,7 @@ title = "Hugo Relearn Documentation"
# settings specific to this theme's features; choose to your likings and # settings specific to this theme's features; choose to your likings and
# consult this documentation for explaination # consult this documentation for explaination
[params] [params]
editURL = "https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/" editURL = "https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content"
description = "Documentation for Hugo Relearn Theme" description = "Documentation for Hugo Relearn Theme"
author = "Sören Weber" author = "Sören Weber"
showVisitedLinks = true showVisitedLinks = true
@ -105,7 +105,7 @@ title = "Hugo Relearn Documentation"
[[Languages.en.menu.shortcuts]] [[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits" name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
url = "credits/" url = "more/credits/"
weight = 30 weight = 30
[[Languages.en.menu.shortcuts]] [[Languages.en.menu.shortcuts]]
@ -145,7 +145,7 @@ title = "Hugo Relearn Documentation"
[[Languages.pir.menu.shortcuts]] [[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Crrredits" name = "<i class='fas fa-fw fa-bullhorn'></i> Crrredits"
url = "credits/" url = "more/credits/"
weight = 30 weight = 30
[[Languages.pir.menu.shortcuts]] [[Languages.pir.menu.shortcuts]]

View file

@ -31,7 +31,7 @@ weight = 20
[[menu.shortcuts]] [[menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits" name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
url = "credits/" url = "more/credits/"
weight = 30 weight = 30
[[menu.shortcuts]] [[menu.shortcuts]]
@ -86,7 +86,7 @@ Example from the current website:
[[Languages.en.menu.shortcuts]] [[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits" name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
url = "credits/" url = "more/credits/"
weight = 30 weight = 30
[[Languages.en.menu.shortcuts]] [[Languages.en.menu.shortcuts]]
@ -120,7 +120,7 @@ Example from the current website:
[[Languages.pir.menu.shortcuts]] [[Languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Crrredits" name = "<i class='fas fa-fw fa-bullhorn'></i> Crrredits"
url = "credits/" url = "more/credits/"
weight = 30 weight = 30
[[Languages.pir.menu.shortcuts]] [[Languages.pir.menu.shortcuts]]

View file

@ -1,10 +1,6 @@
+++ +++
disableToc = true disableToc = true
title = "Showcase" title = "Showcase"
[_build]
render = "always"
list = "never"
publishResources = true
+++ +++
## [GoboLinux Wiki](https://wiki.gobolinux.org/) by GoboLinux.org ## [GoboLinux Wiki](https://wiki.gobolinux.org/) by GoboLinux.org

View file

@ -1,9 +1,5 @@
+++ +++
disableToc = true disableToc = true
title = "Showcase" title = "Showcase"
[_build]
render = "always"
list = "never"
publishResources = true
+++ +++
{{< piratify >}} {{< piratify >}}

View file

@ -32,8 +32,13 @@
<div id="top-bar"><div> <div id="top-bar"><div>
{{- $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev)) }} {{- $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev)) }}
{{- if $showPrevNext }} {{- if $showPrevNext }}
{{- $parent := .Parent }}
{{- $ispublished := true }}
{{- if $parent }}
{{- $ispublished = gt (int (len $parent.Permalink)) 0 }}
{{- end }}
<div class="navigation"> <div class="navigation">
{{- if ($.Scratch.Get "relearnNextPage") }} {{- if and $ispublished ($.Scratch.Get "relearnNextPage") }}
{{- with ($.Scratch.Get "relearnNextPage") }} {{- with ($.Scratch.Get "relearnNextPage") }}
<a class="nav nav-next" href="{{.RelPermalink}}" title="{{.Title}}"><i class="fas fa-chevron-right fa-fw"></i></a> <a class="nav nav-next" href="{{.RelPermalink}}" title="{{.Title}}"><i class="fas fa-chevron-right fa-fw"></i></a>
{{- end }} {{- end }}
@ -42,7 +47,7 @@
{{- end }} {{- end }}
</div> </div>
<div class="navigation"> <div class="navigation">
{{- if ($.Scratch.Get "relearnPrevPage") }} {{- if and $ispublished ($.Scratch.Get "relearnPrevPage") }}
{{- with ($.Scratch.Get "relearnPrevPage") }} {{- with ($.Scratch.Get "relearnPrevPage") }}
<a class="nav nav-prev" href="{{.RelPermalink}}" title="{{.Title}}"><i class="fas fa-chevron-left fa-fw"></i></a> <a class="nav nav-prev" href="{{.RelPermalink}}" title="{{.Title}}"><i class="fas fa-chevron-left fa-fw"></i></a>
{{- end}} {{- end}}