Some additional details that I thought about but not entirely sure of:
-
asset
would take in any path in the repo, in the case one wants to publish assets without any processing, sotemp
wouldn’t be special from the viewpoint of this function. -
static
would make sense as a directory that get’s published regardless of whetherasset
was called for its files. However, files published from there would keep their original file names. (Of course because of the point 1. one could also publish a file instatic
withasset
, in which case the filename would contain the hash) -
temp
could be made to enjoy special treatment in the sense that Zola would trust the hash in its filenames to be correct without checking the contents. - How to reconcile sass with this system? If one would want “full unification” without it getting any special treatment, I would guess that having opted in to the asset pipeline, user would link to the generated css like this
{{ asset(sass("sass/styles.scss")) }}
. If one wants to keep some special treatment, here’s some alternatives:- Provide a variable
sass
that already contains the result path of the compilation intemp
and use it like{{ asset(sass) }}
. - Provide a variable
sass
that already contains the result path of the compilation AND the “asset export” inpublic
.
- Provide a variable
- Some other kinds of asset processing I’m thinking of, besides image processing and inlining, is web font optimisation, but it might go pretty far out of scope of what Zola wants to do.