jnordberg / wintersmith

A flexible static site generator
http://wintersmith.io/
MIT License
3.5k stars 332 forks source link

Asset hashes or versioning #351

Open zladuric opened 2 years ago

zladuric commented 2 years ago

Hello, Is there a way to create asset hashes or something similar in content names? I want to cache css and js files, but I can't do that unless I somehow address it. I've tried searching without success: is there an option, an API, a plugin that does this? So that when I have a script block like this:

script(src=contents.js['main.js'].url)

...that it generates the output similar to this:

<script src="main.<CONTENT_SHA>.js"></script>

...or something similar to that? Timestamps, version numbers, anything?