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.
{{% children sort="weight" %}}
{{% children sort="title" %}}
## Usage
@ -16,7 +16,7 @@ While the examples are using shortcodes with named parameter you are free to als
{{% tab title="shortcode" %}}
````go
{{%/* children sort="weight" */%}}
{{%/* children sort="title" */%}}
````
{{% /tab %}}
@ -25,7 +25,7 @@ While the examples are using shortcodes with named parameter you are free to als
````go
{{ partial "shortcodes/children.html" (dict
"page" .
"sort" "weight"
"sort" "title"
)}}
````

View file

@ -21,7 +21,7 @@
{{- with $page }}
{{ (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" . }}
{{ (printf "</%s>" $containerstyle)|safeHTML }}
{{- end }}
@ -66,7 +66,7 @@
{{- (printf "<%s>" $.containerstyle)|safeHTML }}
{{- 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 }}
{{- if eq $.style "li" }}