Skip to content
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

Make it possible to generate srcset with the thumbnail template tag #575

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

autoantwort
Copy link
Contributor

Instead of

{% thumbnail 'x400' image.image as img %}
{% thumbnail 'x800' image.image as img2 %}
{% thumbnail 'x1200' image.image as img3 %}
    <img src="{{ img.url }}"
         srcset="{{ img.url }}, {{ img2.url }} 2x, {{ img3.url }} 3x"
         height="{{ img.height }}" width="{{ img.width }}">

one can write

{% thumbnail 'x400' bar.image srcset="2 3" %}

@vstoykov
Copy link
Collaborator

Thank you @autoantwort for your contribution. Can I ask you to add simple test that is rendering the template tag and observe the output of it?

@vstoykov vstoykov merged commit aea457b into matthewwithanm:develop Jul 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants