mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-22 23:37:53 +00:00
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:
parent
6ac6a48df0
commit
bed830f385
9 changed files with 47 additions and 45 deletions
|
@ -1,7 +0,0 @@
|
|||
+++
|
||||
title = "{{ replace .Name "-" " " | title }}"
|
||||
type = "chapter-overview"
|
||||
weight = 1
|
||||
+++
|
||||
|
||||
This is a new chapter.
|
|
@ -4,21 +4,7 @@ type = "releasenotes"
|
|||
weight = 2
|
||||
+++
|
||||
|
||||
# Version 7
|
||||
|
||||
{{% include "basics/releasenotes/7" %}}
|
||||
|
||||
---
|
||||
|
||||
# Version 6
|
||||
|
||||
{{% include "basics/releasenotes/6" %}}
|
||||
|
||||
---
|
||||
|
||||
# Version 5
|
||||
|
||||
{{% include "basics/releasenotes/5" %}}
|
||||
{{% pages showhidden="true" hidevisible="true" showtitle="true" showdivider="true" %}}
|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
+++
|
||||
[_build]
|
||||
list = "never"
|
||||
publishResources = false
|
||||
+++
|
||||
|
||||
For a detailed list of changes, see the [history page](basics/history).
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
+++
|
||||
[_build]
|
||||
list = "never"
|
||||
publishResources = false
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
ordersectionsby = "title"
|
||||
title = "Shortcodes"
|
||||
type = "chapter-overview"
|
||||
type = "chapter"
|
||||
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.
|
||||
|
||||
The Relearn theme provides multiple shortcodes on top of existing ones.
|
||||
|
||||
{{% children containerstyle="div" style="h2" description=true %}}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
ordersectionsby = "title"
|
||||
title = "Shorrrtcodes"
|
||||
type = "chapter-overview"
|
||||
type = "chapter"
|
||||
weight = 3
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -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>
|
35
layouts/partials/shortcodes/pages.html
Normal file
35
layouts/partials/shortcodes/pages.html
Normal 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 }}
|
7
layouts/shortcodes/pages.html
Normal file
7
layouts/shortcodes/pages.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{- partial "shortcodes/pages.html" (dict
|
||||
"page" .Page
|
||||
"hidevisible" (.Get "hidevisible")
|
||||
"showhidden" (.Get "showhidden")
|
||||
"showtitle" (.Get "showtitle")
|
||||
"showdivider" (.Get "showdivider")
|
||||
) }}
|
Loading…
Reference in a new issue