layouts/shortcodes/children.html
{{ $type := .Get "type" | default "articles" }} {{ $show := .Get "show" | default "all" }} {{ $hlevel := .Get "hlevel" | default "h3"}} {{ $readMore := .Get "readmore" | default false }} {{ $hr := .Get "hr" | default false }} {{ $doNotList := .Get "filterOut" | default "" }} {{ 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") }} {{ .Scratch.Set "pages" .Page.RegularPages }} {{ end }} {{ $pages := where (.Scratch.Get "pages") "Title" "not in" (split $doNotList ", ") }} {{ if eq $type "articles" }}
{{ range $pages.ByWeight }} {{ $title := default .Title .Params.list_title | .RenderString }} {{ $url := default .RelPermalink .Params.external_url }} {{ $target := cond (ne .Params.external_url nil) "_blank" "" }} {{ if eq $hlevel "h2"}}
{{ else if eq $hlevel "h3"}}
{{ else if eq $hlevel "h4"}}
{{end}}
{{- if .Description }}{{- .Description | .RenderString -}} {{ else }}{{- .Summary | .RenderString -}} {{ end -}}
{{ if .Params.list_image }} {{ $img := .Params.list_image }} {{ if (fileExists ( print "/static" $img )) }} {{ with (imageConfig ( print "/static" $img )) }} {{ $imageWidth := div .Width 3 }} {{ end }} {{ else }} {{ end }} {{ end }} {{ if .Params.list_code_example }} {{- $productData := partial "product/get-data.html" $ -}} {{- $placeholderHost := $productData.placeholder_host | default "localhost:8086" }} {{ .Params.list_code_example | replaceRE \{\{[\<\%] influxdb/host [\>%]\}\} $placeholderHost | .RenderString }} {{ end }} {{ if .Params.list_query_example }} {{ range (index .Site.Data.query_examples .Params.list_query_example) }} {{ .code | markdownify }}
{{ .input | markdownify }}
{{ .output | markdownify }}
{{ end }} {{ end }} {{ if and (eq $readMore true) (or .Params.list_query_example .Params.list_code_example) }}
{{ end }} {{ if eq $hr true }}
{{ end }} {{ end }} {{ else if (eq $type "functions") }}
{{ range $pages.ByWeight }} {{ $title := replaceRE \ function "" .Title }} - {{ if .Params.list_title }}{{ .Params.list_title }}{{ else }}{{ $title }}{{ end }}
{{ end }}
{{ else if (eq $type "list") }}
{{ range $pages.ByWeight }} {{ $title := default .Title .Params.list_title | .RenderString }} {{ $url := default .RelPermalink .Params.external_url }} {{ $target := cond (ne .Params.external_url nil) "_blank" "" }} {{ $note := cond (ne .Params.list_note nil) (print "" .Params.list_note "") "" }} - {{ $title }} {{ $note | markdownify }} {{ end }}
{{ else if (eq $type "ordered-list") }}
{{ range $pages.ByWeight }} {{ $title := default .Title .Params.list_title | .RenderString}} {{ $url := default .RelPermalink .Params.external_url }} {{ $target := cond (ne .Params.external_url nil) "_blank" "" }} {{ $note := cond (ne .Params.list_note nil) (print "" .Params.list_note "") "" }} 1. {{ $title }} {{ $note | markdownify }} {{ end }}
{{ else if (eq $type "anchored-list") }} {{ range $pages.ByWeight }} {{ $title := default .Title .Params.list_title | .RenderString }} - {{ $title }} {{ end }} {{ end }}