mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-31 00:47:13 +00:00
theme: rename dependencies.html #891
This commit is contained in:
parent
dbfada89d6
commit
fe70bb4e46
4 changed files with 22 additions and 20 deletions
|
@ -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 %}}
|
||||
|
|
|
@ -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>
|
||||
|
|
17
layouts/partials/dependencies.gotmpl
Normal file
17
layouts/partials/dependencies.gotmpl
Normal 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 }}
|
|
@ -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" . }}
|
Loading…
Add table
Reference in a new issue