-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use variables in static tag (dynamic assets) #87
Comments
Thank you for filling a bug! Does it work when static part got some string in it? Like
|
That was my second thought: {% for image in images %}
<img src="{% static './' + image %}">
{% endfor %}
and tried to put images in a subfolder: {% for image in ['first.jpg', 'second.jpg'] %}
<img src="{% static 'images/' + image %}">
{% endfor %}
or {% for image in ['/first.jpg', '/second.jpg'] %}
<img src="{% static 'images/' + image %}">
{% endfor %}
I can create a repository to reproduce this error if needed. |
That weird. I will debug it after 19.00 (Moscow time) Looks like there bugs in both AST parsing and StaticExtension. Can you create repo to reproduce both cases? |
Of course, want to help as much as I can |
I'm afraid loader lack of support for "dynamic-only" assets. I need to change assets output format and the way i examine that it is actually dynamic and not a static path. I guess i will make path on weekend. I will fix a trailing slash problem for now ( |
My tests didn't catch trailing slash problem. Patch for problem is ready, but I should to reproduce it in tests first. I will continue with patch today, or on the weekend. |
Great job, thank you so much for such a quick response! |
I will reopen this issue because i fix only one problem. |
Hi, first of all, I would like to thank you. Nice repo!
Is this a bug or am I doing something wrong?
Can't use variables in static tag (dynamic assets)
or
Expected behavior
We have a list of images:
And I want to use them in the template:
Config
Plugin
Loader
The text was updated successfully, but these errors were encountered: