Allow configurable `head` items for CSS or JS files
Currently it is necessary to overwrite the core/_head.html
template (and configure a priority template directory for its path) in order to add resources to the head
section of the emitted HTML content.
This is relevant for embedding additional CSS or JS assets.
At the moment there seem to be two use-cases:
- A) refer to CSS stylesheet (e.g. )
- B) include raw JS snippet (e.g. for matomo)
Instead we could offer configuration settings for these common necessities (without template overrides):
-
stylesheets: []
(list of URLs or paths) -
javascript_snippets: []
(list of raw JS code fragments)- this would offer the additional benefit, that we can calculate the JS checksum for
CSP_SCRIPT_SRC
automatically, instead of forcing the admin to do this manually
- this would offer the additional benefit, that we can calculate the JS checksum for
There are some open questions:
- Would this be useful?
- Are stylesheet references sufficient or should we provide generic header entries instead (for arbitrary raw HTML)?
- Would
javascript_snippets
be the proper name or should we name itjavascript_header_snippets
, in order to allow future configuration settings for other places?