docs: make releasenotes page immutable #917

content of the releasenotes page is solely controlled by the `hidden` front matter value of each version subpage
This commit is contained in:
Sören Weber 2024-09-17 21:25:34 +02:00
parent 6ac6a48df0
commit bed830f385
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
9 changed files with 47 additions and 45 deletions

View file

@ -1,7 +0,0 @@
+++
title = "{{ replace .Name "-" " " | title }}"
type = "chapter-overview"
weight = 1
+++
This is a new chapter.

View file

@ -4,21 +4,7 @@ type = "releasenotes"
weight = 2 weight = 2
+++ +++
# Version 7 {{% pages showhidden="true" hidevisible="true" showtitle="true" showdivider="true" %}}
{{% include "basics/releasenotes/7" %}}
---
# Version 6
{{% include "basics/releasenotes/6" %}}
---
# Version 5
{{% include "basics/releasenotes/5" %}}
--- ---

View file

@ -1,7 +1,6 @@
+++ +++
[_build] [_build]
list = "never" list = "never"
publishResources = false
+++ +++
For a detailed list of changes, see the [history page](basics/history). For a detailed list of changes, see the [history page](basics/history).

View file

@ -1,6 +1,5 @@
+++ +++
[_build] [_build]
list = "never" list = "never"
publishResources = false
+++ +++
{{< piratify >}} {{< piratify >}}

View file

@ -1,7 +1,7 @@
+++ +++
ordersectionsby = "title" ordersectionsby = "title"
title = "Shortcodes" title = "Shortcodes"
type = "chapter-overview" type = "chapter"
weight = 3 weight = 3
+++ +++
@ -12,3 +12,5 @@ But this happens to be a bad idea. Everyone uses Markdown because it's pure and
To avoid this limitations, Hugo created [shortcodes](https://gohugo.io/extras/shortcodes/). A shortcode is a simple snippet inside a page. To avoid this limitations, Hugo created [shortcodes](https://gohugo.io/extras/shortcodes/). A shortcode is a simple snippet inside a page.
The Relearn theme provides multiple shortcodes on top of existing ones. The Relearn theme provides multiple shortcodes on top of existing ones.
{{% children containerstyle="div" style="h2" description=true %}}

View file

@ -1,7 +1,7 @@
+++ +++
ordersectionsby = "title" ordersectionsby = "title"
title = "Shorrrtcodes" title = "Shorrrtcodes"
type = "chapter-overview" type = "chapter"
weight = 3 weight = 3
+++ +++
{{< piratify >}} {{< piratify >}}

View file

@ -1,19 +0,0 @@
<article class="chapter narrow">
<header class="headline">
{{- partial "content-header.html" . }}
</header>
{{ partial "heading-pre.html" . }}<div class="article-subheading">{{ T "Chapter" .Params.Weight }}</div>
{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
{{ partial "article-content.html" . }}
{{ partial "shortcodes/children.html" (dict
"page" .
"containerstyle" "div"
"style" "h2"
"description" "true"
)}}
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
</article>

View file

@ -0,0 +1,35 @@
{{- $showtitle := .showtitle | default false }}
{{- if eq (printf "%T" $showtitle) "string" }}
{{- $showtitle = (eq $showtitle "true") }}
{{- end }}
{{- $showdivider := .showdivider | default false }}
{{- if eq (printf "%T" $showdivider) "string" }}
{{- $showdivider = (eq $showdivider "true") }}
{{- end }}
{{- $showhidden := .showhidden | default false }}
{{- if eq (printf "%T" $showhidden) "string" }}
{{- $showhidden = (eq $showhidden "true") }}
{{- end }}
{{- $hidevisible := .hidevisible | default false }}
{{- if eq (printf "%T" $hidevisible) "string" }}
{{- $hidevisible = (eq $hidevisible "true") }}
{{- end }}
{{- $pages := partialCached "_relearn/pages.gotmpl" (dict "page" .page) }}
{{- $needsdivider := false }}
{{- range $pages }}
{{- $display := or
(and $.showhidden (or .Params.hidden (eq .Title "")) )
(and (not $.hidevisible) (not (or .Params.hidden (eq .Title ""))) )
}}
{{- if $display }}
{{ if and $.showdivider $needsdivider }}
---
{{ end }}
{{ if and $.showtitle .Title }}
# {{ .Title }}
{{ end }}
{{ .RenderShortcodes }}
{{ end }}
{{- $needsdivider = true }}
{{- end }}

View file

@ -0,0 +1,7 @@
{{- partial "shortcodes/pages.html" (dict
"page" .Page
"hidevisible" (.Get "hidevisible")
"showhidden" (.Get "showhidden")
"showtitle" (.Get "showtitle")
"showdivider" (.Get "showdivider")
) }}