Skip to content

Commit

Permalink
Sort pages and section by weight
Browse files Browse the repository at this point in the history
  • Loading branch information
clementbiron committed Dec 18, 2024
1 parent ed5aa6b commit de25c64
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions themes/opentermsarchive/layouts/partials/aside.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@
<details {{ if eq $currentPageSection .Section }}open{{ end }}>
<summary><b>{{ .LinkTitle | markdownify }}</b></summary>
<ul>
{{ range .RegularPages.ByWeight }}
<li>
<a href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify }}</a>
</li>
{{ end }}
{{ range .Sections.ByWeight }}
{{ $allPages := .RegularPages.ByWeight | append .Sections.ByWeight }}
{{ $allPages := sort $allPages "Weight" }}
{{ range $allPages }}
<li>
{{ if .Content }}
<a href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify }}</a>
<a href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify }}</a>
{{ else }}
<span>{{ .LinkTitle | markdownify }}</span>
<span>{{ .LinkTitle | markdownify }}</span>
{{ end }}
{{ if .IsSection }}
<ul>
{{ range .RegularPages.ByWeight }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify }}</a></li>
{{ end }}
</ul>
{{ end }}
<ul>
{{ range .RegularPages.ByWeight }}
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle | markdownify }}</a></li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
Expand Down

0 comments on commit de25c64

Please sign in to comment.