I don’t know if this is possible or out of scope for the great new Hugo Pipes.
Until now, I’ve been using Gulp to minify a JSON file in the /data
folder (besides several Sass/JavaScript tasks which are now gone thanks to Pipes). My project uses something like this to create a simple dictionary from a data file:
*gulp tasks*
{{ range .Site.Data.dictionary }}
This works fine and creates my dictionary from the /data/dictionary.json
file.
Skipping some details, this is what I would like is to do instead:
{{ $jsonSource := resources.Get "dictionary.json" }}
{{ $dictionary := $jsonSource | resources.Minify }
{{ range .Site.Data.$dictionary }}
The above obviously does no good.
The thought of {{ $dictionary.Permalink }}
in all this is slightly confusing, since this creates public/dictionary.min.json
.
Is there any way to take advantage of assets minification of a data template file like this?