Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./highlightHeadline.js";
import "./contentNavigation.js";
import "./anchorlinks.js";
import "./dropdown.js";
import "./darkmode.js";
import "./search.js";
import "./interactiveMap.js";
import "./expander.js";
4 changes: 3 additions & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
{{ printf "%s | %s" .Title site.Title }}
{{ end }}
</title>
{{ partial "head/js" (dict "file" "js/darkmode.js" "defer" false) }}

{{ $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed") }}
{{ with resources.Get "sass/main.scss" }}
{{ $style := (resources.ExecuteAsTemplate "sass/main_templated.scss" $ .) | toCSS $options | minify }}
Expand All @@ -24,7 +26,7 @@
new PagefindHighlight({ highlightParam: "highlight" });
</script>

{{ partialCached "head/js" . }}
{{ partial "head/js" (dict "file" "js/main.js") }}


<!-- include a favicon for your site if you have it, else omit the line below
Expand Down
10 changes: 7 additions & 3 deletions layouts/partials/head/js.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{{- with resources.Get "js/main.js" }}
{{ $defer := .defer | default true }}
{{- with resources.Get .file }}
{{- if eq hugo.Environment "development" }}
{{- with . | js.Build }}
<script src="{{ .RelPermalink }}"></script>
<script
src="{{ .RelPermalink }}"
{{ if $defer -}}defer{{- end }}
></script>
{{- end }}
{{- else }}
{{- $opts := dict "minify" true }}
Expand All @@ -12,7 +16,7 @@
src="{{ .RelPermalink }}"
integrity="{{- .Data.Integrity }}"
crossorigin="anonymous"
defer
{{- if $defer }}defer{{- end }}
></script>
{{- end }}
{{- end }}
Expand Down
Loading