mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
9b0050e9aa
git-subtree-dir: docs git-subtree-split: 5c085a37b297bf12f59efeaae591418ec025c10d
22 lines
581 B
HTML
22 lines
581 B
HTML
{{- $heading := "See also" }}
|
|
{{- $related := site.RegularPages.Related . | first 5 }}
|
|
|
|
{{- if in (slice "functions" "methods") .Type }}
|
|
{{- $related = slice }}
|
|
{{- range .Params.action.related }}
|
|
{{- with site.GetPage (lower .) }}
|
|
{{- $related = $related | append . }}
|
|
{{- else }}
|
|
{{- errorf "The 'related' partial was unable to get page %s" . }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{- with $related }}
|
|
<h2>{{ $heading }}</h2>
|
|
<ul>
|
|
{{- range . }}
|
|
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
|
{{- end }}
|
|
</ul>
|
|
{{- end }}
|