theme: rename dependencies.html #891

This commit is contained in:
Sören Weber 2024-09-24 15:56:12 +02:00
parent dbfada89d6
commit fe70bb4e46
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
4 changed files with 22 additions and 20 deletions

View file

@ -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 %}}

View file

@ -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" . }}
</head>
<body class="mobile-support {{ with .Store.Get "relearnOutputFormat" }}{{ . }}{{ else }}html{{ end }}{{- if .Site.Params.disableInlineCopyToClipBoard }} disableInlineCopyToClipboard{{ end }}{{- if .Site.Params.disableHoverBlockCopyToClipBoard }} disableHoverBlockCopyToClipBoard{{ end }}" data-url="{{ partial "permalink.gotmpl" (dict "to" .) }}">
@ -76,7 +76,7 @@
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
<script src="{{"js/clipboard.min.js" | relURL}}{{ $assetBusting }}" defer></script>
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ $assetBusting }}" defer></script>
{{- partial "dependencies.html" (dict "page" . "location" "footer") }}
{{- partial "dependencies.gotmpl" (dict "page" . "location" "footer") }}
<script src="{{"js/theme.js" | relURL}}{{ $assetBusting }}" defer></script>
{{- partial "custom-footer.html" . }}
</body>

View file

@ -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 }}

View file

@ -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 }}
{{- 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" . }}