Comments (5)
Would a thing like postprocessor <path>
for addtoblock
solve this? That postprocessor could translate the paths.
from django-sekizai.
Yes, that's exactly the thing I was thinking about.
However, I would name it preprocessor, but that's a question of taste.
Something else to consider: How shall the mapping rule be defined?
We could write
{% addtoblock "css" %}<link href="{% static %}css/my-style.scss" rel="stylesheet" type="text/x-scss" />{% endaddtoblock %}
and use text/x-scss
as the key for applying a rule, or we could write
{% addtoblock "scss" %}<link href="{% static %}css/my-style.scss" rel="stylesheet" type="text/css" />{% endaddtoblock %}
and use scss
as the key for applying a rule.
One of the advantages I see using the latter proposal, is to convert files found in directory bower_compontents
directly into the Google's CDN counterpart. Today, I used the package https://github.com/sindresorhus/gulp-google-cdn and it does a perfect job. This means that with Sekizai, then we could convert external dependencies managed by bower from a local include to a CDN include.
from django-sekizai.
Yes, that's exactly the thing I was thinking about.
However, I would name it preprocessor, but that's a question of taste.
Great, I'll add that then.
Something else to consider: How shall the mapping rule be defined?
We could write
{% addtoblock "css" %}{% endaddtoblock %}
and use text/x-scss as the key for applying a rule, or we could write
{% addtoblock "scss" %}{% endaddtoblock %}
and use scss as the key for applying a rule.
As with the render_block
postprocessor, I won't actually implement any pre/post-processors in sekizai, so this is really up to the implementation.
from django-sekizai.
Upgrade sekizai to 0.8.1 or higher to get preprocessor
in addtoblock
.
from django-sekizai.
As with the render_block postprocessor, I won't actually implement any pre/post-processors in sekizai, so this is really up to the implementation.
Sure, that's much better. And it keeps the template tags symmetrical! Use postprocessor in {% render_block ... %}
and preprocessor in {% addtoblock ... %}
.
from django-sekizai.
Related Issues (20)
- Documentation on readthedocs is out of date HOT 2
- Add support for Django 3.2 HOT 4
- Error when adding Sekizai HOT 1
- 3.0.0: Tests missing in sdist tarball on pypi.org HOT 4
- The use of setup.py test is deprecated HOT 1
- RTD maintenance HOT 2
- helpers._scan_namespaces silently gives up when encountering a with_data node (SekizaiParser dropping template nodes?) HOT 13
- Code alerts by lgtm HOT 1
- Django 4.2 support? HOT 2
- Is it possible to detect an empty block?
- Missing tag for 1.0.0 release HOT 2
- pep8 dependency should be replaced by pycodestyle HOT 1
- Use flake8 instead of pep8 HOT 1
- tests missing from pypi sdist HOT 3
- Can`t use render_to_string without a given request HOT 1
- Django 3.1 compatibility HOT 2
- Remove compatibility import of Context in django.template.base HOT 1
- Import Error with Django 3.1 HOT 1
- 2.0.0 installs tests top-level HOT 1
- sekizai tag addtoblock silently ignored HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-sekizai.