26 lines
775 B
HTML
26 lines
775 B
HTML
{{- $items := . -}}
|
|
{{- if gt (len $items) 0 -}}
|
|
<ul>
|
|
{{- $type := printf "%T" $items -}}
|
|
{{- $isTextList := hasPrefix $type "[]string" -}}
|
|
{{- if $isTextList -}}
|
|
{{- range sort $items -}}
|
|
<li>{{ . }}</li>
|
|
{{- end -}}
|
|
{{- else -}}
|
|
{{- range sort $items "Title" -}}
|
|
{{- $itemType := printf "%T" . -}}
|
|
{{- $isPage := or (strings.HasPrefix $itemType "*hugolib.") (strings.HasPrefix $itemType "page.") -}}
|
|
{{- if $isPage -}}
|
|
<li>
|
|
<a href="{{ .RelPermalink }}">{{ with .LinkTitle }}{{ . }}{{ else }}{{ .Title }}{{ end }}</a>
|
|
{{ with .Pages }}<sub>{{ len . }}</sub>{{ else }}<sub>0</sub>{{ end }}
|
|
</li>
|
|
{{- else -}}
|
|
<li>{{ . }}</li>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
</ul>
|
|
{{- end -}}
|