Comments (1)
I was dumb, jinja2 docs made it slightly clearer:
{% for score in scores -%}
{% if loop.index == 1 -%}
🥇 {{ loop.index }}. {{ score }}
{% else if loop.index == 2 -%}
🥈 {{ loop.index }}. {{ score }}
{% else if loop.index == 3 -%}
🥉 {{ loop.index }}. {{ score }}
{% else if loop.last -%}
🤡 {{ loop.index }}. {{ score }}
{% else -%}
{{ loop.index }}. {{ score }}
{% endif -%}
{% endfor -%}
Fixes the issue.
from askama.
Related Issues (20)
- Fuzzing askama_parser results in panic HOT 3
- Can I pass None as arg to a macro? HOT 4
- Variable use with inheritence HOT 5
- askama_derive update breaks filter usage with spaces HOT 2
- question: xml templates support HOT 2
- relative template paths and include_str support HOT 7
- Generic iterator field for a template HOT 6
- `num as {integer}` cast does not work? HOT 4
- Suggestion: improve external API for adding framework integrations HOT 3
- Conditional compiling? HOT 5
- Allow to have named arguments in macro HOT 5
- Filters and binary OR operations are easily confused HOT 10
- Problems comparing integers HOT 1
- SVG support HOT 4
- is it possible to use imports with filters, or make the import an expression? HOT 1
- Macro with unknown variants in match block compiles HOT 6
- Feature request: enhance match to include multiple targets HOT 1
- global variables HOT 5
- Associated functions on structs with generics are not callable HOT 2
- How could i get session flash message in a view after redirect HOT 2
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 askama.