diff options
author | Florian Dold <florian@dold.me> | 2021-05-07 16:22:09 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-05-07 16:22:09 +0200 |
commit | 4347e801511f46233b1bd8b53a4728e7c5a40b95 (patch) | |
tree | 296ae18308b5b1d0484dd6a2eeb09cbd48d58ff7 | |
parent | 6edf14cc9e50722052faecbbd222b6b097e81b1e (diff) | |
download | www-4347e801511f46233b1bd8b53a4728e7c5a40b95.tar.gz www-4347e801511f46233b1bd8b53a4728e7c5a40b95.zip |
less hacky old news
-rw-r--r-- | common/old-news.j2.inc | 44 | ||||
-rw-r--r--[l---------] | template/news/oldnews-2011.html.j2 | 6 | ||||
-rw-r--r--[l---------] | template/news/oldnews-2013.html.j2 | 6 | ||||
-rw-r--r-- | template/news/oldnews-2018.html.j2 | 49 | ||||
-rw-r--r--[l---------] | template/news/oldnews-2019.html.j2 | 6 |
5 files changed, 61 insertions, 50 deletions
diff --git a/common/old-news.j2.inc b/common/old-news.j2.inc new file mode 100644 index 00000000..c11ac0c5 --- /dev/null +++ b/common/old-news.j2.inc | |||
@@ -0,0 +1,44 @@ | |||
1 | {% macro oldnews(year) %} | ||
2 | <div class="container-fluid"> | ||
3 | <div class="container"> | ||
4 | <article> | ||
5 | <div class="row"> | ||
6 | <div class="container text-center"> | ||
7 | <h1>{{ _("News") + " " + (year|string) }}<a name="news"></a></h1> | ||
8 | <section> | ||
9 | <p> | ||
10 | {% trans %} | ||
11 | News posts about changes related to | ||
12 | GNUnet such as releases and events | ||
13 | {% endtrans %} | ||
14 | – | ||
15 | <a href="{{ url_localized('rss.xml') }}">{{ _("subscribe to our RSS feed") }}</a> | ||
16 | </p> | ||
17 | </section> | ||
18 | </div> | ||
19 | </div> | ||
20 | <div class="row"> | ||
21 | <b>{{ year }}</b> | ||
22 | <ul class="timeline"> | ||
23 | {% for item in newsdata|selectattr('date.year', 'eq', year) %} | ||
24 | <li> | ||
25 | <section class="item-preview"> | ||
26 | <header> | ||
27 | <h3>{{ item['title']|e }}</h3> | ||
28 | <p class="item-date"> | ||
29 | {{ item['date'] }} | ||
30 | </p> | ||
31 | </header> | ||
32 | <p class="item-abstract"> | ||
33 | {{ item['abstract'] }} <br/> | ||
34 | [<a href="{{ item['page'] }}" title="{{ item['date']}}">{{ _("read more") }}</a>] | ||
35 | </p> | ||
36 | </section> | ||
37 | </li> | ||
38 | {% endfor %} | ||
39 | </ul> | ||
40 | </div> | ||
41 | </article> | ||
42 | </div> | ||
43 | </div> | ||
44 | {% endmacro %} | ||
diff --git a/template/news/oldnews-2011.html.j2 b/template/news/oldnews-2011.html.j2 index ef5fcbee..39e76a48 120000..100644 --- a/template/news/oldnews-2011.html.j2 +++ b/template/news/oldnews-2011.html.j2 | |||
@@ -1 +1,5 @@ | |||
1 | oldnews-2018.html.j2 \ No newline at end of file | 1 | {% extends "common/base.j2" %} |
2 | {% from "common/old-news.j2.inc" import oldnews with context %} | ||
3 | {% block body_content %} | ||
4 | {{ oldnews(2011) }} | ||
5 | {% endblock body_content %} | ||
diff --git a/template/news/oldnews-2013.html.j2 b/template/news/oldnews-2013.html.j2 index ef5fcbee..d725f006 120000..100644 --- a/template/news/oldnews-2013.html.j2 +++ b/template/news/oldnews-2013.html.j2 | |||
@@ -1 +1,5 @@ | |||
1 | oldnews-2018.html.j2 \ No newline at end of file | 1 | {% extends "common/base.j2" %} |
2 | {% from "common/old-news.j2.inc" import oldnews with context %} | ||
3 | {% block body_content %} | ||
4 | {{ oldnews(2013) }} | ||
5 | {% endblock body_content %} | ||
diff --git a/template/news/oldnews-2018.html.j2 b/template/news/oldnews-2018.html.j2 index b5833a31..3056892c 100644 --- a/template/news/oldnews-2018.html.j2 +++ b/template/news/oldnews-2018.html.j2 | |||
@@ -1,50 +1,5 @@ | |||
1 | {% extends "common/base.j2" %} | 1 | {% extends "common/base.j2" %} |
2 | {% from "common/old-news.j2.inc" import oldnews with context %} | ||
2 | {% block body_content %} | 3 | {% block body_content %} |
3 | <!-- Simply link to or copy this file as-is (no modifications required) | 4 | {{ oldnews(2018) }} |
4 | news/oldnews-::year::. This will generate a new news archive page. | ||
5 | Note that you may still have to modify the currently displayed | ||
6 | year ranges in the index.html.j2. | ||
7 | --> | ||
8 | <div class="container-fluid"> | ||
9 | <div class="container"> | ||
10 | <article> | ||
11 | <div class="row"> | ||
12 | <div class="container text-center"> | ||
13 | <h1>{{ _("News") + " " + self._TemplateReference__context.name[13:17] }}<a name="news"></a></h1> | ||
14 | <section> | ||
15 | <p> | ||
16 | {% trans %} | ||
17 | News posts about changes related to | ||
18 | GNUnet such as releases and events | ||
19 | {% endtrans %} | ||
20 | – | ||
21 | <a href="{{ url_localized('rss.xml') }}">{{ _("subscribe to our RSS feed") }}</a> | ||
22 | </p> | ||
23 | </section> | ||
24 | </div> | ||
25 | </div> | ||
26 | <div class="row"> | ||
27 | <b>{{ self._TemplateReference__context.name[13:17] }}</b> | ||
28 | <ul class="timeline"> | ||
29 | {% for item in newsdata|selectattr('date.year', 'eq', self._TemplateReference__context.name[13:17]|int) %} | ||
30 | <li> | ||
31 | <section class="item-preview"> | ||
32 | <header> | ||
33 | <h3>{{ item['title']|e }}</h3> | ||
34 | <p class="item-date"> | ||
35 | {{ item['date'] }} | ||
36 | </p> | ||
37 | </header> | ||
38 | <p class="item-abstract"> | ||
39 | {{ item['abstract'] }} <br/> | ||
40 | [<a href="{{ item['page'] }}" title="{{ item['date']}}">{{ _("read more") }}</a>] | ||
41 | </p> | ||
42 | </section> | ||
43 | </li> | ||
44 | {% endfor %} | ||
45 | </ul> | ||
46 | </div> | ||
47 | </article> | ||
48 | </div> | ||
49 | </div> | ||
50 | {% endblock body_content %} | 5 | {% endblock body_content %} |
diff --git a/template/news/oldnews-2019.html.j2 b/template/news/oldnews-2019.html.j2 index ef5fcbee..23691b6c 120000..100644 --- a/template/news/oldnews-2019.html.j2 +++ b/template/news/oldnews-2019.html.j2 | |||
@@ -1 +1,5 @@ | |||
1 | oldnews-2018.html.j2 \ No newline at end of file | 1 | {% extends "common/base.j2" %} |
2 | {% from "common/old-news.j2.inc" import oldnews with context %} | ||
3 | {% block body_content %} | ||
4 | {{ oldnews(2019) }} | ||
5 | {% endblock body_content %} | ||