docs-v2/layouts/shortcodes/children.html

29 lines
584 B
HTML
Raw Normal View History

{{ $pages := union .Page.Pages .Page.Sections }}
{{ $type := .Get "type" | default "articles" }}
<div class="children-links">
{{ if eq $type "articles" }}
{{ range $pages.ByWeight }}
<h3><a href="{{ .RelPermalink }}" >{{ .Title }}</a></h3>
<p>
{{- if .Description }}{{- .Description -}}
{{ else }}{{- .Summary -}}
{{ end -}}
</p>
{{ end }}
{{ else if (eq $type "functions") }}
<ul>
{{ range $pages.ByWeight }}
{{ $title := replaceRE `\(\)\ function` "" .Title }}
<li><a href="{{ .RelPermalink }}">{{ $title }}</a></li>
{{ end }}
<ul>
{{ end }}
</div>