{{- $refImg := "" -}} {{- $refPage := "" -}} {{- $img := .Params.img -}} {{- if .Params.imgRef -}} {{- range where .Site.RegularPages "Params.pageid" "eq" .Params.imgRef -}} {{- $refImg = .Params.img -}} {{- $refPage = . -}} {{- end -}} {{- end -}} {{- if not $img -}} {{- $img = $refImg -}} {{- end -}} {{ if $img -}} {{- $image := (resources.Get (printf "img/%s" $img)).Resize "400x" -}} {{- if $refPage -}} {{ $refPage.Title }} {{- else -}} {{ .Title }} {{- end -}} {{- else if .Params.teaser -}}
{{ .Params.teaser }}
{{- else if .Site.Params.defaultImage -}} Default Dmage {{- else if .Params.Summary -}}
{{ .Params.Summary }}
{{- end }} {{ with .Params.Topics -}}

{{i18n "topics"}}

{{ range . -}} {{- $page := $.GetPage (printf "/topics/%s" .) -}} {{ $page.Title }} {{- end }}
{{- end }} {{- if not .Site.Params.hideParentArticles -}} {{- $related := where .Site.RegularPages "Params.pageid" "in" .Params.parents -}} {{- partial "card-related" (dict "related" $related "header" (i18n "parent-articles") "id" "parents") -}} {{- end -}} {{- if and (not .Site.Params.hideChildArticles) (ne .Site.Params.showChildArticles "sidebar") -}} {{- $related := .Site.RegularPages.RelatedTo (keyVals "parents" .Params.pageid) -}} {{- partial "card-related" (dict "related" $related "header" (i18n "child-articles") "id" "children") -}} {{- end -}} {{- if not .Site.Params.hideRelatedArticles -}} {{- $related := .Site.RegularPages.RelatedIndices . "topics" -}} {{- partial "card-related" (dict "related" $related "header" (i18n "related-articles") "id" "related") -}} {{- end -}} {{- if not .Site.Params.hideSiblingArticles -}} {{- $related := .Site.RegularPages.RelatedIndices . "parents" -}} {{- partial "card-related" (dict "related" $related "header" (i18n "sibling-articles") "id" "siblings") -}} {{- end -}} {{- if not .Site.Params.hideSectionArticles -}} {{- $section := or .Section "posts" -}} {{- $header := or (i18n (printf "articles-in-%s" $section)) (i18n "articles-in-section") -}} {{- $related := first 20 (where .Site.RegularPages "Section" $section) -}} {{- partial "card-related" (dict "related" $related "header" $header "id" "articles-in-section") -}} {{- end -}} {{- if not .Site.Params.hideBacklinks -}} {{- $related := .Scratch.Get "backlinks" -}} {{- partial "card-related" (dict "related" $related "header" (i18n "backlinks") "id" "backlinks") -}} {{- end -}} {{- if .Params.showtoc -}}

{{i18n "toc"}}

{{ .TableOfContents }}
{{- end -}}