github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/themes/docsy/layouts/partials/section-index.html (about)

     1  <div class="section-index">
     2      {{ $parent := .Page }}
     3      {{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
     4      {{ $pages = (where $pages "Type" "!=" "search") }}
     5      {{ $pages = (where $pages ".Params.hide_summary" "!=" true) }}
     6      {{ $pages = (where $pages ".Parent" "!=" nil) }}
     7      {{ $pages = (where $pages "Parent.File.UniqueID" "==" $parent.File.UniqueID) }}
     8      {{ if or $parent.Params.no_list (eq (len $pages) 0) }}
     9      {{/* If no_list is true or we don't have subpages we don't show a list of subpages */}}
    10      {{ else if $parent.Params.simple_list }}
    11      {{/* If simple_list is true we show a bulleted list of subpages */}}
    12          <ul>
    13              {{ range $pages }}
    14                  {{ $manualLink := cond (isset .Params "manuallink") .Params.manualLink ( cond (isset .Params "manuallinkrelref") (relref . .Params.manualLinkRelref) .RelPermalink) }}
    15                  <li><a href="{{ $manualLink }}"{{ with .Params.manualLinkTitle }} title="{{ . }}"{{ end }}{{ with .Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }}>{{- .Title -}}</a></li>
    16              {{ end }}
    17          </ul>
    18      {{ else }}
    19      {{/* Otherwise we show a nice formatted list of subpages with page descriptions */}}
    20      <hr class="panel-line">
    21          {{ range $pages }}
    22              {{ $manualLink := cond (isset .Params "manuallink") .Params.manualLink ( cond (isset .Params "manuallinkrelref") (relref . .Params.manualLinkRelref) .RelPermalink) }}
    23              <div class="entry">
    24                  <h5>
    25                      <a href="{{ $manualLink }}"{{ with .Params.manualLinkTitle }} title="{{ . }}"{{ end }}{{ with .Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }}>{{- .Title -}}</a>
    26                  </h5>
    27                  <p>{{ .Description | markdownify }}</p>
    28              </div>
    29          {{ end }}
    30      {{ end }}
    31  </div>