|
| 1 | +{{/* (C) 2026 GoodData Corporation |
| 2 | + Local override of Docsy's section-index partial. Subpage entry titles use |
| 3 | + <h2> (not <h5>) so the document heading order never skips a level; the |
| 4 | + small visual size is preserved via .section-index__title in layout.scss. */}} |
| 5 | +<div class="section-index"> |
| 6 | + {{ $parent := .Page }} |
| 7 | + {{ $pages := (where .Site.Pages "Section" .Section).ByWeight }} |
| 8 | + {{ $pages = (where $pages "Type" "!=" "search") }} |
| 9 | + {{ $pages = (where $pages ".Params.hide_summary" "!=" true) }} |
| 10 | + {{ $pages = (where $pages ".Parent" "!=" nil) }} |
| 11 | + {{ $pages = (where $pages "Parent.File.UniqueID" "==" $parent.File.UniqueID) }} |
| 12 | + {{ if or $parent.Params.no_list (eq (len $pages) 0) }} |
| 13 | + {{/* If no_list is true or we don't have subpages we don't show a list of subpages */}} |
| 14 | + {{ else if $parent.Params.simple_list }} |
| 15 | + {{/* If simple_list is true we show a bulleted list of subpages */}} |
| 16 | + <ul> |
| 17 | + {{ range $pages }} |
| 18 | + {{ $manualLink := cond (isset .Params "manuallink") .Params.manualLink ( cond (isset .Params "manuallinkrelref") (relref . .Params.manualLinkRelref) .RelPermalink) }} |
| 19 | + <li><a href="{{ $manualLink }}"{{ with .Params.manualLinkTitle }} title="{{ . }}"{{ end }}{{ with .Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }}>{{- .Title -}}</a></li> |
| 20 | + {{ end }} |
| 21 | + </ul> |
| 22 | + {{ else }} |
| 23 | + {{/* Otherwise we show a nice formatted list of subpages with page descriptions */}} |
| 24 | + <hr class="panel-line"> |
| 25 | + {{ range $pages }} |
| 26 | + {{ $manualLink := cond (isset .Params "manuallink") .Params.manualLink ( cond (isset .Params "manuallinkrelref") (relref . .Params.manualLinkRelref) .RelPermalink) }} |
| 27 | + <div class="entry"> |
| 28 | + <h2 class="section-index__title"> |
| 29 | + <a href="{{ $manualLink }}"{{ with .Params.manualLinkTitle }} title="{{ . }}"{{ end }}{{ with .Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }}>{{- .Title -}}</a> |
| 30 | + </h2> |
| 31 | + <p>{{ .Description | markdownify }}</p> |
| 32 | + </div> |
| 33 | + {{ end }} |
| 34 | + {{ end }} |
| 35 | +</div> |
0 commit comments