Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/chipzoller/hugo-clarity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorweru <fromweru@gmail.com>2022-05-14 22:15:34 +0300
committerweru <16350351+onweru@users.noreply.github.com>2022-05-17 02:38:18 +0300
commitcad1992c41bd58375c96b541d992d76cfe63b39b (patch)
treedb2450b62143f5154b6e175d72ca1b2be716ec3a
parent1f4ee2e04305d638149da8dfe121b96644961658 (diff)
isolate scripts definition from base template
Signed-off-by: weru <fromweru@gmail.com>
-rw-r--r--layouts/_default/baseof.html16
-rw-r--r--layouts/partials/scripts.html8
2 files changed, 13 insertions, 11 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 76125f8..da9a1db 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,27 +1,21 @@
{{- $s := site.Params }}
{{- $p := .Params }}
-{{ $codeBlockConfig := partial "func/getCodeBlockSettings" . }}
+{{- $codeBlockConfig := partial "func/getCodeBlockSettings" . }}
<!DOCTYPE html>
<html lang="{{ .Lang }}" data-figures="{{ $p.figurePositionShow }}"{{ if .IsPage }} class="page"{{ end }}{{ if .IsHome }} class="home"{{ end }}{{ with $s.enforceLightMode }} data-mode="lit"{{ end }}{{ with $s.enforceDarkMode }} data-mode="dim"{{ end }}>
<head>
{{- partial "head" . }}
- {{ partial "hooks/head-end.html" . }}
+ {{- partial "hooks/head-end" . }}
</head>
<body data-code="{{ $codeBlockConfig.max }}" data-lines="{{ $codeBlockConfig.lines }}" id="documentTop">
{{- partial "header" . }}
<main>
{{- block "main" . }}{{ end }}
</main>
+
{{- partialCached "icons" . }}
{{- partialCached "footer" . }}
- {{ $bundle := partialCached "func/getJavascriptBundle" . }}
- <script type="text/javascript" src="{{ $bundle.Permalink }}" integrity="{{ $bundle.Data.Integrity }}" crossorigin="anonymous"></script>
- {{- partial "search/scripts" . }}
- {{- with $s.customJS }}
- {{- range . -}}
- <script type="text/javascript" src="{{ relURL . }}" ></script>
- {{- end }}
- {{- end }}
- {{ partialCached "hooks/body-end.html" . }}
+ {{- partialCached "scripts" . }}
+ {{- partialCached "hooks/body-end" . }}
</body>
</html>
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
new file mode 100644
index 0000000..acedf23
--- /dev/null
+++ b/layouts/partials/scripts.html
@@ -0,0 +1,8 @@
+{{- $bundle := partialCached "func/getJavascriptBundle" . }}
+<script type="text/javascript" src="{{ $bundle.Permalink }}" integrity="{{ $bundle.Data.Integrity }}" crossorigin="anonymous"></script>
+{{- partial "search/scripts" . }}
+{{- with site.Params.customJS }}
+ {{- range . -}}
+ <script type="text/javascript" src="{{ relURL . }}"></script>
+ {{- end }}
+{{- end }} \ No newline at end of file