hugo-theme-relearn/layouts/partials/dependencies.html

12 lines
556 B
HTML
Raw Normal View History

{{- $page := .page }}
{{- $location := .location }}
{{- $outputFormat := .outputFormat }}
{{- range $k, $v := $page.Site.Params.relearn.dependencies }}
{{- $has := printf "has%s" $v.name }}
{{- $nestedhas := printf "nestedHas%s" $v.name }}
{{- $wants := or ($page.Page.Store.Get $has) (and ($page.Page.Store.Get (printf "%sIsNested" $outputFormat)) ($page.Page.Store.Get $nestedhas)) }}
{{- if and $wants (eq $location $v.location) }}
{{- $dep := printf "dependencies/%s.html" $k }}
{{- partial $dep (dict "page" $page) }}
{{- end }}
{{- end }}