2019-02-06 15:42:58 +00:00
|
|
|
{{ $type := .Get "type" | default "articles" }}
|
2019-02-06 16:03:32 +00:00
|
|
|
{{ $show := .Get "show" | default "all" }}
|
|
|
|
|
|
|
|
{{ if eq $show "all" }}
|
|
|
|
{{ .Scratch.Set "pages" (union .Page.Pages .Page.Sections) }}
|
|
|
|
{{ else if (eq $show "sections") }}
|
|
|
|
{{ .Scratch.Set "pages" .Page.Sections }}
|
|
|
|
{{ else if (eq $show "pages") }}
|
2020-03-04 16:11:00 +00:00
|
|
|
{{ .Scratch.Set "pages" .Page.RegularPages }}
|
2019-02-06 16:03:32 +00:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ $pages := .Scratch.Get "pages" }}
|
2019-01-22 19:04:11 +00:00
|
|
|
|
|
|
|
<div class="children-links">
|
2019-02-06 15:42:58 +00:00
|
|
|
{{ if eq $type "articles" }}
|
2019-01-22 19:04:11 +00:00
|
|
|
|
2019-02-06 15:42:58 +00:00
|
|
|
{{ range $pages.ByWeight }}
|
2019-03-25 16:21:10 +00:00
|
|
|
<h3><a href="{{ .RelPermalink }}" >{{ if .Params.list_title }}{{ .Params.list_title }}{{ else }}{{ .Title }}{{ end }}</a></h3>
|
2019-02-06 15:42:58 +00:00
|
|
|
<p>
|
2019-02-22 17:11:51 +00:00
|
|
|
{{- if .Description }}{{- .Description | markdownify -}}
|
|
|
|
{{ else }}{{- .Summary | markdownify -}}
|
2019-02-06 15:42:58 +00:00
|
|
|
{{ end -}}
|
|
|
|
</p>
|
2019-06-13 17:51:46 +00:00
|
|
|
{{ if .Params.list_image }}
|
|
|
|
{{ $img := .Params.list_image }}
|
|
|
|
{{ if (fileExists ( print "/static" $img )) }}
|
|
|
|
{{ with (imageConfig ( print "/static" $img )) }}
|
|
|
|
{{ $imageWidth := div .Width 3 }}
|
|
|
|
<img src='{{ $img }}' width='{{ $imageWidth }}' />
|
|
|
|
{{ end }}
|
|
|
|
{{ else }}
|
|
|
|
<img src='{{ $img }}'/>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2019-02-06 15:42:58 +00:00
|
|
|
{{ end }}
|
2019-01-22 19:04:11 +00:00
|
|
|
|
2019-02-06 15:42:58 +00:00
|
|
|
{{ else if (eq $type "functions") }}
|
2019-01-22 19:04:11 +00:00
|
|
|
|
2019-02-06 15:42:58 +00:00
|
|
|
<ul>
|
|
|
|
{{ range $pages.ByWeight }}
|
2019-02-11 21:26:13 +00:00
|
|
|
{{ $title := replaceRE `\ function` "" .Title }}
|
2020-03-11 16:22:32 +00:00
|
|
|
{{ $url := cond ( isset .Params "external_url" ) .Params.external_url .RelPermalink }}
|
|
|
|
{{ $target := cond ( isset .Params "external_url" ) "_blank" "" }}
|
|
|
|
{{ $note := cond ( isset .Params "list_note" ) (print "<span class='list-note'>" .Params.list_note "</span>") "" }}
|
|
|
|
<li><a href="{{ $url }}" target="{{ $target }}">{{ if .Params.list_title }}{{ .Params.list_title }}{{ else }}{{ $title }}{{ end }}</a> {{ $note | markdownify }}</span></li>
|
2019-02-06 15:42:58 +00:00
|
|
|
{{ end }}
|
|
|
|
<ul>
|
2019-01-22 19:04:11 +00:00
|
|
|
|
2019-02-06 15:42:58 +00:00
|
|
|
{{ end }}
|
2019-01-22 19:04:11 +00:00
|
|
|
|
|
|
|
|
2019-02-06 15:42:58 +00:00
|
|
|
</div>
|