diff --git a/exampleSite/content/configuration/customization/_index.en.md b/exampleSite/content/configuration/customization/_index.en.md index 3a177520be..3265dbd66d 100644 --- a/exampleSite/content/configuration/customization/_index.en.md +++ b/exampleSite/content/configuration/customization/_index.en.md @@ -227,7 +227,7 @@ See the `math`, `mermaid` and `openapi` shortcodes for examples. If you are really into customization of the theme and want to use the dependency loader for your own locations, you can do this by simply calling it from inside of your overriden partials ````go -{{- partial "dependencies.html" (dict "page" . "location" "mylocation") }} +{{- partial "dependencies.gotmpl" (dict "page" . "location" "mylocation") }} ```` {{% /notice %}} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 56d8105e9f..e3cbedd667 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -37,7 +37,7 @@ {{- end }} {{- partialCached "favicon.html" . }} {{- partial "stylesheet.html" . }} - {{- partial "dependencies.html" (dict "page" . "location" "header") }} + {{- partial "dependencies.gotmpl" (dict "page" . "location" "header") }} {{- partial "custom-header.html" . }}
@@ -76,7 +76,7 @@ {{- $assetBusting := partialCached "assetbusting.gotmpl" . }} -{{- partial "dependencies.html" (dict "page" . "location" "footer") }} +{{- partial "dependencies.gotmpl" (dict "page" . "location" "footer") }} {{- partial "custom-footer.html" . }} diff --git a/layouts/partials/dependencies.gotmpl b/layouts/partials/dependencies.gotmpl new file mode 100644 index 0000000000..3d061cbeda --- /dev/null +++ b/layouts/partials/dependencies.gotmpl @@ -0,0 +1,17 @@ +{{- $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 }} \ No newline at end of file diff --git a/layouts/partials/dependencies.html b/layouts/partials/dependencies.html index 3d061cbeda..bae60655ae 100644 --- a/layouts/partials/dependencies.html +++ b/layouts/partials/dependencies.html @@ -1,17 +1,2 @@ -{{- $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 }} \ No newline at end of file +{{- warnf "DEPRECATED partial 'dependencies.html' used, use 'dependencies.gotmpl' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/releasenotes/7/#7-0-0" }} +{{- partial "dependencies.gotmpl" . }} \ No newline at end of file