Description
I believe, the documentation for extra_context in the PIPELINE_CSS/JS packages is a bit misleading.
As I understood the documentation, all keys/values I assign to extra_context would be passed to the templates as a dictionary and be iterated over to include them all as attributes of the <script/link>
tags.
The only attribute that works for is basically media for CSS links.
In my eyes, the desired behaviour would be to pass extra_context
directly to the template, maybe except for the media key, and include all keys as attributes.
Currently, since extra_context
is not passed to the template, but all the keys separately, one cannot even iterate over the keys but has to modify the templates for every attribute.
In our case, we'd like to use requre.js as a package and need to pass a "data-main" attribute, which requre.js uses to load other packages.
I guess there's a design decision to do here, so I did not implement anything yet. But if you are ok with this, I could write some code here. Please let me know what you think.
Cheers,
Fabian