mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-27 10:52:09 +00:00
2badbe2601
This gives files much smaller fingerprints, and supports caching.
5 lines
284 B
HTML
5 lines
284 B
HTML
{{ $resource := resources.Get . -}}
|
|
{{- $target_path_formatStr := (replaceRE `(\.[^\.]*)$` ".%d$1" .) -}}
|
|
{{- $cacheBuster := $resource.Content | crypto.FNV32a -}}
|
|
{{- $target_path := printf $target_path_formatStr $cacheBuster -}}
|
|
{{- return resources.Copy $target_path $resource -}}
|