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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,9 @@
+++
title = "Showcase"
[_build]
render = "always"
list = "never"
publishResources = true
+++
## [GoboLinux Wiki](https://wiki.gobolinux.org/) by NEONsys.org
@ -10,6 +14,6 @@ title = "Showcase"
![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)

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