From a856400626bb7356eee170fbaeee84f84dbf03e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 18 Feb 2022 02:13:35 +0100 Subject: [PATCH] #nav: fix arrow nav for unlisted pages #184 #185 --- exampleSite/config.toml | 6 +++--- exampleSite/content/cont/menushortcuts.en.md | 6 +++--- .../content/{credits.en.md => more/credits/_index.en.md} | 0 .../{credits.pir.md => more/credits/_index.pir.md} | 0 exampleSite/content/more/showcase/_index.en.md | 4 ---- exampleSite/content/more/showcase/_index.pir.md | 4 ---- layouts/partials/header.html | 9 +++++++-- 7 files changed, 13 insertions(+), 16 deletions(-) rename exampleSite/content/{credits.en.md => more/credits/_index.en.md} (100%) rename exampleSite/content/{credits.pir.md => more/credits/_index.pir.md} (100%) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index a393ff95f7..f8cf9eb29c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -27,7 +27,7 @@ title = "Hugo Relearn Documentation" # settings specific to this theme's features; choose to your likings and # consult this documentation for explaination [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" author = "Sören Weber" showVisitedLinks = true @@ -105,7 +105,7 @@ title = "Hugo Relearn Documentation" [[Languages.en.menu.shortcuts]] name = " Credits" - url = "credits/" + url = "more/credits/" weight = 30 [[Languages.en.menu.shortcuts]] @@ -145,7 +145,7 @@ title = "Hugo Relearn Documentation" [[Languages.pir.menu.shortcuts]] name = " Crrredits" - url = "credits/" + url = "more/credits/" weight = 30 [[Languages.pir.menu.shortcuts]] diff --git a/exampleSite/content/cont/menushortcuts.en.md b/exampleSite/content/cont/menushortcuts.en.md index ec191a024e..8c8aaa374b 100644 --- a/exampleSite/content/cont/menushortcuts.en.md +++ b/exampleSite/content/cont/menushortcuts.en.md @@ -31,7 +31,7 @@ weight = 20 [[menu.shortcuts]] name = " Credits" -url = "credits/" +url = "more/credits/" weight = 30 [[menu.shortcuts]] @@ -86,7 +86,7 @@ Example from the current website: [[Languages.en.menu.shortcuts]] name = " Credits" - url = "credits/" + url = "more/credits/" weight = 30 [[Languages.en.menu.shortcuts]] @@ -120,7 +120,7 @@ Example from the current website: [[Languages.pir.menu.shortcuts]] name = " Crrredits" - url = "credits/" + url = "more/credits/" weight = 30 [[Languages.pir.menu.shortcuts]] diff --git a/exampleSite/content/credits.en.md b/exampleSite/content/more/credits/_index.en.md similarity index 100% rename from exampleSite/content/credits.en.md rename to exampleSite/content/more/credits/_index.en.md diff --git a/exampleSite/content/credits.pir.md b/exampleSite/content/more/credits/_index.pir.md similarity index 100% rename from exampleSite/content/credits.pir.md rename to exampleSite/content/more/credits/_index.pir.md diff --git a/exampleSite/content/more/showcase/_index.en.md b/exampleSite/content/more/showcase/_index.en.md index b879bb40ba..8764981b66 100644 --- a/exampleSite/content/more/showcase/_index.en.md +++ b/exampleSite/content/more/showcase/_index.en.md @@ -1,10 +1,6 @@ +++ disableToc = true title = "Showcase" -[_build] - render = "always" - list = "never" - publishResources = true +++ ## [GoboLinux Wiki](https://wiki.gobolinux.org/) by GoboLinux.org diff --git a/exampleSite/content/more/showcase/_index.pir.md b/exampleSite/content/more/showcase/_index.pir.md index f42a6695c6..013c1b0488 100644 --- a/exampleSite/content/more/showcase/_index.pir.md +++ b/exampleSite/content/more/showcase/_index.pir.md @@ -1,9 +1,5 @@ +++ disableToc = true title = "Showcase" -[_build] - render = "always" - list = "never" - publishResources = true +++ {{< piratify >}} \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 01216225e3..0d04aa3ab0 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -32,8 +32,13 @@
{{- $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev)) }} {{- if $showPrevNext }} + {{- $parent := .Parent }} + {{- $ispublished := true }} + {{- if $parent }} + {{- $ispublished = gt (int (len $parent.Permalink)) 0 }} + {{- end }}