Hi, folks--
I am trying again to learn how to use Ersatz. I am trying to render pages
that display sequences of similar components (e.g. blog posts). The
template syntax includes 'for' loops, e.g.
{% for p in posts %}
<div class="blog-post">
<h3>{{ p.title }}</h3>
<div class="post-body">
{{ p.body }}
</div>
</div>
{% endfor %}
Or ... I'm pretty sure the following would work in Jinja2 (where the
'posts' variable is a list in the form [[<post>, <body>] ...]):
{% for title, body in posts %}
<div class="blog-post">
<h3>{{ title }}</h3>
<div class="post-body">
{{ body }}
</div>
</div>
{% endfor %}
So, do these constructs work in ersatz? If so, what data structures do I
want to pass as the models: argument when rendering the templates?
Thanks for any info!
--
Matt Gushee
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users