print: enable print for pages with _build options #522

This commit is contained in:
Sören Weber 2023-05-18 00:12:47 +02:00
parent 754b5c85ab
commit f38878f664
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
11 changed files with 41 additions and 60 deletions

View file

@ -100,7 +100,7 @@ disableHugoGeneratorInject = true
[[languages.en.menu.shortcuts]] [[languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases" name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "more/showcase/" url = "showcase/"
weight = 11 weight = 11
[[languages.en.menu.shortcuts]] [[languages.en.menu.shortcuts]]
@ -140,7 +140,7 @@ disableHugoGeneratorInject = true
[[languages.pir.menu.shortcuts]] [[languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases" name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "more/showcase/" url = "showcase/"
weight = 11 weight = 11
[[languages.pir.menu.shortcuts]] [[languages.pir.menu.shortcuts]]

View file

@ -20,7 +20,7 @@ weight = 10
[[menu.shortcuts]] [[menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases" name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "more/showcase/" url = "showcase/"
weight = 11 weight = 11
[[menu.shortcuts]] [[menu.shortcuts]]
@ -75,7 +75,7 @@ Example from the current website:
[[languages.en.menu.shortcuts]] [[languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases" name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "more/showcase/" url = "showcase/"
weight = 11 weight = 11
[[languages.en.menu.shortcuts]] [[languages.en.menu.shortcuts]]
@ -109,7 +109,7 @@ Example from the current website:
[[languages.pir.menu.shortcuts]] [[languages.pir.menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases" name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "more/showcase/" url = "showcase/"
weight = 11 weight = 11
[[languages.pir.menu.shortcuts]] [[languages.pir.menu.shortcuts]]

View file

@ -1,5 +1,4 @@
+++ +++
disableToc = true
title = "Credits" title = "Credits"
+++ +++

View file

@ -1,5 +1,4 @@
+++ +++
disableToc = true
title = "Crrredits" title = "Crrredits"
+++ +++
{{< piratify >}} {{< piratify >}}

View file

@ -1,4 +0,0 @@
+++
title = "Showcase"
+++
{{< piratify >}}

View file

@ -1,5 +1,9 @@
+++ +++
title = "Showcase" title = "Showcase"
[_build]
render = "always"
list = "never"
publishResources = true
+++ +++
## [GoboLinux Wiki](https://wiki.gobolinux.org/) by NEONsys.org ## [GoboLinux Wiki](https://wiki.gobolinux.org/) by NEONsys.org
@ -10,6 +14,6 @@ title = "Showcase"
![BITS image](bits-train.png?width=60pc&classes=shadow) ![BITS image](bits-train.png?width=60pc&classes=shadow)
## [Pamasol Electrics](https://pamasol.github.io/de/) by Pamasol Swiss Aerosol Solutions ## [Pamasol Electrics](https://pamasol.github.io/de/) by Pamasol
![Pamasol Electrics](pamasol-electrics-portal.png?width=60pc&classes=shadow) ![Pamasol Electrics](pamasol-electrics-portal.png?width=60pc&classes=shadow)

View file

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

View file

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

View file

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 240 KiB

View file

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 156 KiB

View file

@ -3,55 +3,34 @@
{{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) true }} {{- $page.Page.Store.Set (printf "%sIsNested" $outputFormat) true }}
{{- with $page }} {{- with $page }}
{{- $currentNode := . }} {{- $currentNode := . }}
{{- $isActive := .IsHome }} {{- $pages := .Pages }}
{{- $isShortcut := false }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
{{- with .Site.Menus.shortcuts }} {{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
{{- range sort . "Weight" }} {{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
{{- $shortcut := . }} {{- if $pages }}
{{- $shortcutPage := $page.Site.GetPage (printf "%s" $shortcut.URL ) }} <section>
{{- if and $shortcutPage (eq $shortcutPage.RelPermalink $page.RelPermalink) }} <h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
{{- $isShortcut = true }} {{- end }}
{{- end }} {{- if eq $currentOrdersectionsby "title" }}
{{- range $pages.ByTitle }}
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
{{- end }}
{{- else }}
{{- range $pages.ByWeight }}
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- $pages := .Site.Home.Pages }} {{- if $pages }}
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} </section>
{{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }}
{{- if $isShortcut }}
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
{{- else }}
{{- if $isActive }}
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
{{- if $pages }}
<section>
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
{{- end }}
{{- end }}
{{- if eq $currentOrdersectionsby "title" }}
{{- range $pages.ByTitle }}
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat "isActive" $isActive }}
{{- end }}
{{- else }}
{{- range $pages.ByWeight }}
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat "isActive" $isActive }}
{{- end }}
{{- end }}
{{- if $isActive }}
{{- if $pages }}
</section>
{{- end }}
{{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "section-tree-print" }} {{- define "section-tree-print" }}
{{- $currentNode := .currentnode }} {{- $currentNode := .currentnode }}
{{- $outputFormat := .outputFormat }} {{- $outputFormat := .outputFormat }}
{{- $isActive := .isActive }}
{{- $currentFileRelPermalink := .currentnode.RelPermalink }} {{- $currentFileRelPermalink := .currentnode.RelPermalink }}
{{- with .sect }} {{- with .sect }}
{{- $isSelf := eq .RelPermalink $currentFileRelPermalink }} {{- $isSelf := eq .RelPermalink $currentFileRelPermalink }}
{{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }} {{- $isAncestor := and (not $isSelf) (.IsAncestor $currentNode) }}
{{- $isActive = or $isSelf $isActive }}
{{- $pages := .Pages }} {{- $pages := .Pages }}
{{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }} {{- $relearnIsHiddenFrom := index ($currentNode.Scratch.Get "relearnIsHiddenFrom") .RelPermalink }}
{{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }} {{- $hidden := and $relearnIsHiddenFrom (not $.showhidden) (not $isSelf) (not $isAncestor) }}
@ -59,26 +38,22 @@
{{- else }} {{- else }}
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }} {{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }} {{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
{{- if $isActive }} {{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
{{- template "section-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }} {{- if $pages }}
{{- if $pages }}
<section> <section>
<h1 class="a11y-only">{{ T "Subsections" .Title }}</h1> <h1 class="a11y-only">{{ T "Subsections" .Title }}</h1>
{{- end }}
{{- end }} {{- end }}
{{- if eq $currentOrdersectionsby "title" }} {{- if eq $currentOrdersectionsby "title" }}
{{- range $pages.ByTitle }} {{- range $pages.ByTitle }}
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat "isActive" $isActive }} {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
{{- end }} {{- end }}
{{- else }} {{- else }}
{{- range $pages.ByWeight }} {{- range $pages.ByWeight }}
{{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat "isActive" $isActive }} {{- template "section-tree-print" dict "sect" . "currentnode" $currentNode "outputFormat" $outputFormat }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if $isActive }} {{- if $pages }}
{{- if $pages }}
</section> </section>
{{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
@ -93,4 +68,4 @@
{{- $currentNode.Page.Store.Set "nestedHasMermaid" (or ($currentNode.Page.Store.Get "nestedHasMermaid") (.Page.Store.Get "hasMermaid")) }} {{- $currentNode.Page.Store.Set "nestedHasMermaid" (or ($currentNode.Page.Store.Get "nestedHasMermaid") (.Page.Store.Get "hasMermaid")) }}
{{- $currentNode.Page.Store.Set "nestedHasOpenapi" (or ($currentNode.Page.Store.Get "nestedHasOpenapi") (.Page.Store.Get "hasOpenapi")) }} {{- $currentNode.Page.Store.Set "nestedHasOpenapi" (or ($currentNode.Page.Store.Get "nestedHasOpenapi") (.Page.Store.Get "hasOpenapi")) }}
{{- end }} {{- end }}
{{- end }} {{- end }}