aboutsummaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-11-07 19:42:04 +0000
committerng0 <ng0@n0.is>2019-11-07 19:42:04 +0000
commitefc09a5d33f51c355ccf259c378d0227e2049d79 (patch)
tree29eecf11caef41658d548118c9b9d43706688899 /inc
parentcccc4e317b2851f24ee43f21c3b1517c0b4ea223 (diff)
downloadwww-efc09a5d33f51c355ccf259c378d0227e2049d79.tar.gz
www-efc09a5d33f51c355ccf259c378d0227e2049d79.zip
use macro for news preview, candidate for near future subrepo.
Diffstat (limited to 'inc')
-rw-r--r--inc/news.macro.j214
1 files changed, 14 insertions, 0 deletions
diff --git a/inc/news.macro.j2 b/inc/news.macro.j2
new file mode 100644
index 00000000..aa7d2ec6
--- /dev/null
+++ b/inc/news.macro.j2
@@ -0,0 +1,14 @@
1{% macro newspreview(name) -%}
2 kwargs = {}
3 <section class="item-preview">
4 <header>
5 <h3>{{ name['title']|e }}</h3>
6 <p class="item-date">
7 {{ name['date'] }}
8 </p>
9 </header>
10 <p class="item-abstract">
11 {{ name['abstract'] }} [<a href="{% if kwargs|length > 0 %}{{ kwargs['prefix'] }}{% endif %}{{ name['page'] }}" title="{{ name['date']}}">{{ _("read more") }}</a>]
12 </p>
13 </section>
14{% endmacro -%}