mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
children: fix sort parameter #898
This commit is contained in:
parent
28975d0dbf
commit
c9a32e7780
2 changed files with 6 additions and 6 deletions
|
@ -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"
|
||||
)}}
|
||||
````
|
||||
|
||||
|
|
|
@ -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" }}
|
||||
|
|
Loading…
Reference in a new issue