Skip to content

Commit

Permalink
children: fix sort parameter #898
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Aug 29, 2024
1 parent 28975d0 commit c9a32e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions exampleSite/content/shortcodes/children/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 %}}
Expand All @@ -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"
)}}
````

Expand All @@ -48,7 +48,7 @@ While the examples are using shortcodes with named parameter you are free to als
### All Default

````go
{{%/* children */%}}
{{%/* children */%}}
````

{{% children %}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/shortcodes/children.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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" }}
Expand Down

0 comments on commit c9a32e7

Please sign in to comment.