Skip to content

Commit

Permalink
Compile JS
Browse files Browse the repository at this point in the history
  • Loading branch information
nikdoof committed Aug 12, 2024
1 parent bd0fde7 commit 45b3e66
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
File renamed without changes.
2 changes: 1 addition & 1 deletion themes/dimension/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}

<script src="{{ .Site.BaseURL }}js/theme.js"></script>
{{ partialCached "css.html" . }}
{{ partialCached "js.html" . }}
</head>
12 changes: 12 additions & 0 deletions themes/dimension/layouts/partials/js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- with resources.Get "js/theme.js" }}
{{- if eq hugo.Environment "development" }}
{{- with . | js.Build }}
<script src="{{ .RelPermalink }}"></script>
{{- end }}
{{- else }}
{{- $opts := dict "minify" true }}
{{- with . | js.Build $opts | fingerprint }}
<script src="{{ .RelPermalink }}" integrity="{{- .Data.Integrity }}" crossorigin="anonymous"></script>
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 45b3e66

Please sign in to comment.