diff --git a/themes/dimension/static/js/theme.js b/themes/dimension/assets/js/theme.js similarity index 100% rename from themes/dimension/static/js/theme.js rename to themes/dimension/assets/js/theme.js diff --git a/themes/dimension/layouts/partials/header.html b/themes/dimension/layouts/partials/header.html index 1d8f4e1..85adada 100644 --- a/themes/dimension/layouts/partials/header.html +++ b/themes/dimension/layouts/partials/header.html @@ -22,6 +22,6 @@ ` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} - {{ partialCached "css.html" . }} + {{ partialCached "js.html" . }} \ No newline at end of file diff --git a/themes/dimension/layouts/partials/js.html b/themes/dimension/layouts/partials/js.html new file mode 100644 index 0000000..26517c0 --- /dev/null +++ b/themes/dimension/layouts/partials/js.html @@ -0,0 +1,12 @@ +{{- with resources.Get "js/theme.js" }} + {{- if eq hugo.Environment "development" }} + {{- with . | js.Build }} + + {{- end }} + {{- else }} + {{- $opts := dict "minify" true }} + {{- with . | js.Build $opts | fingerprint }} + + {{- end }} + {{- end }} +{{- end }}