-
I’ve got a special output format for a page (the homepage) that builds json by traversing through particular hugo content types to resize a bunch of images and get the .RelPermaLink for each one
-
The images don’t change super often so the json is served via CDN with a long cache time. I need to cache-bust the file though, so…
-
I thought I could use the “fingerprint” function on the page output. BUT…it seems that fingerprinting only works for page “resources” (or stuff in the “assets” folder) - is that true?
Is what I’m trying to do feasible?
figured it out already. What I really needed was to put my “page” in the assets folder, then use
ExecuteAsTemplate
{{ $imagesTemplate := resources.Get "trip_first_images.js" }}
{{ $secureJS := $imagesTemplate | resources.ExecuteAsTemplate "assets/trip_first_images.js" . | fingerprint }} }}
<script src='{{ $secureJS.RelPermalink }}'></script>
1 Like
In sense of what Hugo can do: No, you can’t fingerprint a post type. You can fingerprint an asset, as you found out already. Basically fingerprinting makes only sense for CSS or JS files, because they could possibly execute foreign code.
1 Like