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.
|
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"
|
||||||
)}}
|
)}}
|
||||||
````
|
````
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ While the examples are using shortcodes with named parameter you are free to als
|
||||||
### All Default
|
### All Default
|
||||||
|
|
||||||
````go
|
````go
|
||||||
{{%/* children */%}}
|
{{%/* children */%}}
|
||||||
````
|
````
|
||||||
|
|
||||||
{{% children %}}
|
{{% children %}}
|
||||||
|
|
|
@ -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" }}
|
||||||
|
|
Loading…
Reference in a new issue