* Add support for SVG files to `get_image_metadata`
* Add support for SVG files to `get_image_metadata`
* Update documentation after adding SVG support
* Don't panic on bad date strings
Instead, show a helpful error message explaining only RFC3339 is
supported.
Fixes#993.
* Try to parse the full range of TOML date formats
* Fix get_url(cachebust=true)
The previous implementation looked for static files in the wrong place.
Look in static_path, output_path and content_path. If file can't be
found in any of them, print a warning to stderr and fall back to using
a timestamp.
Add a test to ensure it also works in practice, not just in theory.
* Implement get_file_hash
If there is no response from the server, `load_data` would panic
with: `response status`.
This patch removes the `expect` in favor of an error message that we
couldn't get a response from the server for a given url.
Cache-busting was previously done with a compile-time timestamp. Change
to the SHA-256 hash of the file to avoid refreshing unchanged files.
The implementation could be used to add a new global fn (say,
get_file_hash) for subresource integrity use, but that's for another
commit.
Fixes#519.
Co-authored-by: Vincent Prouillet <balthek@gmail.com>
Also change a few other things to use it, as noted in CHANGELOG.md.
TODO:
- Write a couple of tests: updated field, last_updated template variable
One slight open questions: should `updated` default to the value of
`date` rather than to None? Then pages with `date` could safely assume
`updated`.
The variable name matched the RSS tag it ended up in, but was misleading
about what it actually was—because if you actually want “last build
date”, you should use `now()`. (Due to the potential for edits, I think
that either there should be an official `updated` field on pages, or
that these templates should use `now()`.)