WRITING-NEWS (2236B)
1 WRITING NEWS 2 ------------ 3 4 make_website.py calls gen_site() with "news" and other arguments 5 when news are to be created. 6 A news item needs to be added in the file www.yml to 'newsposts' like 7 so: 8 9 - page: filename.html 10 date: YYYY-MM-DD 11 title: the title of the news 12 abstract: 13 content: 14 15 abstract and content are filled by make_website.py in a way which works 16 but needs further improvements, as you can't use jinja2 templating for 17 urls (yet). 18 The news are ordered via the yaml file right now, which means that new 19 posts should get inserted at the top. 20 21 The news is written in the file 'filename.html.j2' in the folder 'news'. 22 This .html.j2 file must extend "common/news.j2". Since we already have 23 a <div> which wraps the content of the filename.html.j2, we do not need 24 further surrounding elements in the news itself. 25 26 News previews are generated from the plaintext of the first <p> element 27 with common html elements (not jinja2!) stripped out. Some but not all 28 jinja2 elements are stripped as well. 29 Small newspreviews (as used by taler.net) do not process the first 30 <p> element but process the date, title, and pagename. 31 32 The rss is generated in a similar fashion like the website, by processing 33 a .xml.j2 file and generating a .xml page from it. Too much structure 34 relies on the yaml file (www.yml). 35 36 37 A news template could look like this: 38 39 40 news/2022-09-01.html.j2: 41 42 {% extends "common/news.j2" %} 43 {% block body_content %} 44 <h1>2022-09-01: GNU Taler v0.7.0 released</h1> 45 <p> 46 We are happy to announce the release of GNU Taler v0.5.0. 47 The main new feature is customer tipping, which allows 48 merchants to pay small rewards directly into a customer's 49 wallet. Technical improvements include numerous performance 50 improvements and bug fixes, as well as a new, simpler to use 51 API for merchants that also enables the implementation of 52 GNU Taler wallets on platforms that do not support 53 WebExtensions. 54 </p> 55 <p> 56 The Chrome and Chromium wallets are available for download 57 via the App store. The exchange, merchant backend and bank 58 components are on the GNU FTP mirrors. 59 </p> 60 {% endblock body_content %} 61 62 63 www.yml: 64 - page: 2022-09-01.html 65 date: 2022-09-01 66 title: GNU Taler v0.7.0 released 67 abstract: 68 content: