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

17 lines
934 B
Go Template
Raw Normal View History

2024-09-24 13:56:12 +00:00
{{- $page := .page }}
{{- $location := .location }}
{{- partialCached "_relearn/dependencies.gotmpl" $page $page.Path }}
{{- range $k, $v := $page.Site.Params.relearn.dependencies }}
{{- $has := printf "has%s" $v.name }}
{{- $hasnested := printf "relearnHasNested%s" $v.name }}
{{- $wants := or ($page.Page.Store.Get $has) (and ($page.Page.Store.Get "relearnIsNested") ($page.Page.Store.Get $hasnested)) }}
{{- if and $wants }}
{{- if $v.location }}
{{- warnf "DEPRECATED parameter 'location' for dependency '%s' configured in your hugo.toml, query the 'location' parameter inside your dependency loader instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/releasenotes/5/#5-27-0" $k}}
{{- end }}
{{- if or (not $v.location) (eq $location $v.location) }}
{{- $dep := printf "dependencies/%s.html" $k }}
{{- partial $dep (dict "page" $page "location" $location) }}
{{- end }}
{{- end }}
{{- end }}