diff --git a/exampleSite/archetypes/chapter-overview.md b/exampleSite/archetypes/chapter-overview.md deleted file mode 100644 index 20619b8ea1..0000000000 --- a/exampleSite/archetypes/chapter-overview.md +++ /dev/null @@ -1,7 +0,0 @@ -+++ -title = "{{ replace .Name "-" " " | title }}" -type = "chapter-overview" -weight = 1 -+++ - -This is a new chapter. \ No newline at end of file diff --git a/exampleSite/content/basics/releasenotes/_index.en.md b/exampleSite/content/basics/releasenotes/_index.en.md index 5aa9af13c3..6c63520dba 100644 --- a/exampleSite/content/basics/releasenotes/_index.en.md +++ b/exampleSite/content/basics/releasenotes/_index.en.md @@ -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" %}} --- diff --git a/exampleSite/content/basics/releasenotes/legend.en.md b/exampleSite/content/basics/releasenotes/legend.en.md index 58164c37f8..c2ee6f0f55 100644 --- a/exampleSite/content/basics/releasenotes/legend.en.md +++ b/exampleSite/content/basics/releasenotes/legend.en.md @@ -1,7 +1,6 @@ +++ [_build] list = "never" - publishResources = false +++ For a detailed list of changes, see the [history page](basics/history). diff --git a/exampleSite/content/basics/releasenotes/legend.pir.md b/exampleSite/content/basics/releasenotes/legend.pir.md index 3899a7c592..fcdd33e618 100644 --- a/exampleSite/content/basics/releasenotes/legend.pir.md +++ b/exampleSite/content/basics/releasenotes/legend.pir.md @@ -1,6 +1,5 @@ +++ [_build] list = "never" - publishResources = false +++ {{< piratify >}} \ No newline at end of file diff --git a/exampleSite/content/shortcodes/_index.en.md b/exampleSite/content/shortcodes/_index.en.md index 77c6a867e9..c8c191a0d0 100644 --- a/exampleSite/content/shortcodes/_index.en.md +++ b/exampleSite/content/shortcodes/_index.en.md @@ -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 %}} diff --git a/exampleSite/content/shortcodes/_index.pir.md b/exampleSite/content/shortcodes/_index.pir.md index 2220c0ee98..90f3c89184 100644 --- a/exampleSite/content/shortcodes/_index.pir.md +++ b/exampleSite/content/shortcodes/_index.pir.md @@ -1,7 +1,7 @@ +++ ordersectionsby = "title" title = "Shorrrtcodes" -type = "chapter-overview" +type = "chapter" weight = 3 +++ {{< piratify >}} \ No newline at end of file diff --git a/exampleSite/layouts/chapter-overview/views/article.html b/exampleSite/layouts/chapter-overview/views/article.html deleted file mode 100644 index c47b4e7fe5..0000000000 --- a/exampleSite/layouts/chapter-overview/views/article.html +++ /dev/null @@ -1,19 +0,0 @@ - -
-
- {{- partial "content-header.html" . }} -
-{{ partial "heading-pre.html" . }}
{{ T "Chapter" .Params.Weight }}
-{{ partial "heading.html" . }}{{ partial "heading-post.html" . }} - -{{ partial "article-content.html" . }} -{{ partial "shortcodes/children.html" (dict - "page" . - "containerstyle" "div" - "style" "h2" - "description" "true" -)}} - -
\ No newline at end of file diff --git a/layouts/partials/shortcodes/pages.html b/layouts/partials/shortcodes/pages.html new file mode 100644 index 0000000000..ebd8a5a995 --- /dev/null +++ b/layouts/partials/shortcodes/pages.html @@ -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 }} \ No newline at end of file diff --git a/layouts/shortcodes/pages.html b/layouts/shortcodes/pages.html new file mode 100644 index 0000000000..75ded8d3ff --- /dev/null +++ b/layouts/shortcodes/pages.html @@ -0,0 +1,7 @@ +{{- partial "shortcodes/pages.html" (dict + "page" .Page + "hidevisible" (.Get "hidevisible") + "showhidden" (.Get "showhidden") + "showtitle" (.Get "showtitle") + "showdivider" (.Get "showdivider") +) }} \ No newline at end of file