mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 10:21:46 +01:00
feat: add fingerprints to the JS file URL to utilize HTTP caching (#1076)
This commit is contained in:
parent
8a7fb33163
commit
788dd497b3
1 changed files with 2 additions and 2 deletions
|
@ -1,12 +1,12 @@
|
|||
{{- partial "helper/external" (dict "Context" . "Namespace" "Vibrant") -}}
|
||||
|
||||
{{- $opts := dict "minify" hugo.IsProduction -}}
|
||||
{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}}
|
||||
{{- $script := resources.Get "ts/main.ts" | js.Build $opts | fingerprint -}}
|
||||
|
||||
<script type="text/javascript" src="{{ $script.RelPermalink }}" defer></script>
|
||||
|
||||
{{- with resources.Get "ts/custom.ts" -}}
|
||||
{{/* Place your custom script in HUGO_SITE_FOLDER/assets/ts/custom.ts */}}
|
||||
{{- $customScript := . | js.Build $opts -}}
|
||||
{{- $customScript := . | js.Build $opts | fingerprint -}}
|
||||
<script type="text/javascript" src="{{ $customScript.RelPermalink }}" defer></script>
|
||||
{{- end -}}
|
Loading…
Reference in a new issue