children: fix sort parameter #898

This commit is contained in:
Sören Weber 2024-08-29 21:29:17 +02:00
parent 28975d0dbf
commit c9a32e7780
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@ title = "Children"
The `children` shortcode lists the child pages of the current page and its descendants. The `children` shortcode lists the child pages of the current page and its descendants.
{{% children sort="weight" %}} {{% children sort="title" %}}
## Usage ## Usage
@ -16,7 +16,7 @@ While the examples are using shortcodes with named parameter you are free to als
{{% tab title="shortcode" %}} {{% tab title="shortcode" %}}
````go ````go
{{%/* children sort="weight" */%}} {{%/* children sort="title" */%}}
```` ````
{{% /tab %}} {{% /tab %}}
@ -25,7 +25,7 @@ While the examples are using shortcodes with named parameter you are free to als
````go ````go
{{ partial "shortcodes/children.html" (dict {{ partial "shortcodes/children.html" (dict
"page" . "page" .
"sort" "weight" "sort" "title"
)}} )}}
```` ````

View file

@ -21,7 +21,7 @@
{{- with $page }} {{- with $page }}
{{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }} {{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }}
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }} {{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "by" $sortTerm) }}
{{- template "childs" dict "menu" $pages "containerstyle" $containerstyle "style" $style "showhidden" $showhidden "count" 1 "depth" $depth "pages" .Site.Pages "description" $withDescription "sortTerm" $sortTerm "page" . }} {{- template "childs" dict "menu" $pages "containerstyle" $containerstyle "style" $style "showhidden" $showhidden "count" 1 "depth" $depth "pages" .Site.Pages "description" $withDescription "sortTerm" $sortTerm "page" . }}
{{ (printf "</%s>" $containerstyle)|safeHTML }} {{ (printf "</%s>" $containerstyle)|safeHTML }}
{{- end }} {{- end }}
@ -66,7 +66,7 @@
{{- (printf "<%s>" $.containerstyle)|safeHTML }} {{- (printf "<%s>" $.containerstyle)|safeHTML }}
{{- end }} {{- end }}
{{- $pages := partial "pageHelper/pagesBy.html" (dict "page" .) }} {{- $pages := partial "pageHelper/pagesBy.html" (dict "page" . "by" $.sortTerm) }}
{{- template "childs" dict "menu" $pages "containerstyle" $.containerstyle "style" $.style "showhidden" $.showhidden "count" (add $.count 1) "depth" $.depth "pages" $.pages "description" $.description "sortTerm" $.sortTerm "page" $page }} {{- template "childs" dict "menu" $pages "containerstyle" $.containerstyle "style" $.style "showhidden" $.showhidden "count" (add $.count 1) "depth" $.depth "pages" $.pages "description" $.description "sortTerm" $.sortTerm "page" $page }}
{{- if eq $.style "li" }} {{- if eq $.style "li" }}