summaryrefslogtreecommitdiff
path: root/doc/WRITING-NEWS
blob: 65d3ead8b8cd9b96eb75e253607ead2943f51bff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
WRITING NEWS
------------

make_website.py calls gen_site() with "news" and other arguments
when news are to be created.
A news item needs to be added in the file www.yml to 'newsposts' like
so:

- page: filename.html
  date: YYYY-MM-DD
  title: the title of the news
  abstract:
  content:

abstract and content are filled by make_website.py in a way which works
but needs further improvements, as you can't use jinja2 templating for
urls (yet).
The news are ordered via the yaml file right now, which means that new
posts should get inserted at the top.

The news is written in the file 'filename.html.j2' in the folder 'news'.
This .html.j2 file must extend "common/news.j2". Since we already have
a <div> which wraps the content of the filename.html.j2, we do not need
further surrounding elements in the news itself.

News previews are generated from the plaintext of the first <p> element
with common html elements (not jinja2!) stripped out. Some but not all
jinja2 elements are stripped as well.
Small newspreviews (as used by taler.net) do not process the first
<p> element but process the date, title, and pagename.

The rss is generated in a similar fashion like the website, by processing
a .xml.j2 file and generating a .xml page from it. Too much structure
relies on the yaml file (www.yml).


A news template could look like this:


news/2022-09-01.html.j2:

{% extends "common/news.j2" %}
{% block body_content %}
<h1>2022-09-01: GNU Taler v0.7.0 released</h1>
<p>
  We are happy to announce the release of GNU Taler v0.5.0.
  The main new feature is customer tipping, which allows
  merchants to pay small rewards directly into a customer&#39;s
  wallet.  Technical improvements include numerous performance
  improvements and bug fixes, as well as a new, simpler to use
  API for merchants that also enables the implementation of
  GNU Taler wallets on platforms that do not support
  WebExtensions.
</p>
<p>
  The Chrome and Chromium wallets are available for download
  via the App store.  The exchange, merchant backend and bank
  components are on the GNU FTP mirrors.
</p>
{% endblock body_content %}


www.yml:
- page: 2022-09-01.html
  date: 2022-09-01
  title: GNU Taler v0.7.0 released
  abstract:
  content: