Commit ad430e4 1 parent 85d66e4 commit ad430e4 Copy full SHA for ad430e4
File tree 3 files changed +26
-47
lines changed
3 files changed +26
-47
lines changed Original file line number Diff line number Diff line change 19
19
< meta http-equiv ="refresh " content ="0; url={{ .Params.redirect_to }} ">
20
20
{{ end }}
21
21
22
- {{ partial "head/js.html" . }}
23
- {{ partial "head/css.html" . }}
22
+ {{ $opts := dict "format" "cjs" }}
23
+ {{ if hugo.IsProduction }}
24
+ {{ $opts = merge $opts (dict "minify" true) }}
25
+ {{ end }}
26
+
27
+ {{ template "InsertJs" (dict "opts" $opts "collection" .Params.JsScripts "type" "text/javascript") }}
28
+ {{ template "InsertJs" (dict "opts" $opts "collection" .Params.JsModules "type" "module") }}
29
+
30
+ {{ define "InsertJs" }}
31
+ {{ $opts := .opts }}
32
+ {{ $type := .type }}
33
+ {{ range .collection }}
34
+ {{- with resources.Get . }}
35
+ {{- with . | js.Build (merge $opts (dict "targetPath" .RelPermalink)) }}
36
+ < script src ="{{ .RelPermalink }} " type ="{{ $type }} "> </ script >
37
+ {{- end }}
38
+ {{- end }}
39
+ {{ end }}
40
+ {{ end }}
41
+
42
+ {{ range (.Params.cssSheets | append "css/theme.css") }}
43
+ {{ with resources.Get . | minify }}
44
+ < link rel ="stylesheet " href ="{{ .RelPermalink }} ">
45
+ {{ end }}
46
+ {{ end }}
47
+
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments