|
1 | | -{% import "macros.html" as macros %} |
| 1 | +{% import "macros.html" as macros -%} |
| 2 | +{% set section_path = feed_url | trim_start_matches(pat=config.base_url ~ "/") | trim_end_matches(pat="feed.xml") -%} |
| 3 | +{% set section = get_section(path=section_path ~ "_index.md") -%} |
2 | 4 | <?xml version="1.0" encoding="utf-8"?> |
3 | 5 | <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"> |
4 | | - <generator uri="https://blog.rust-lang.org/{{ section.path }}" version="0.1.0">{{ section.title }}</generator> |
5 | | - <link href="https://blog.rust-lang.org/{{ section.path }}feed.xml" rel="self" type="application/atom+xml" /> |
6 | | - <link href="https://blog.rust-lang.org/{{ section.path }}" rel="alternate" type="text/html" /> |
7 | | - <id>https://blog.rust-lang.org/{{ section.path }}</id> |
| 6 | + <generator uri="https://blog.rust-lang.org{{ section.path | safe }}" version="0.1.0">{{ section.title }}</generator> |
| 7 | + <link href="https://blog.rust-lang.org{{ section.path | safe }}feed.xml" rel="self" type="application/atom+xml" /> |
| 8 | + <link href="https://blog.rust-lang.org{{ section.path | safe }}" rel="alternate" type="text/html" /> |
| 9 | + <id>https://blog.rust-lang.org{{ section.path | safe }}</id> |
8 | 10 | <title>{{ section.title }}</title> |
9 | 11 | <subtitle>{{ section.description }}</subtitle> |
10 | 12 | <author> |
11 | | - <name>Maintained by {{ section.maintained_by }}.</name> |
| 13 | + <name>Maintained by {{ section.extra.maintained_by }}.</name> |
12 | 14 | <uri>https://github.com/rust-lang/blog.rust-lang.org/</uri> |
13 | 15 | </author> |
14 | | - <updated>{{feed_updated}}</updated> |
| 16 | + <updated>{{ now() | date(format="%Y-%m-%dT%H:%M:%S+00:00") }}</updated> |
15 | 17 |
|
16 | | - {% for page in pages %} |
| 18 | + {% for page in section.pages | reverse %} |
17 | 19 | <entry> |
18 | | - <title>{{ macros::escape_hbs(input=page.title) }}</title> |
19 | | - <link rel="alternate" href="https://blog.rust-lang.org/{{ section.path }}{{ macros::escape_hbs(input=page.path) }}" type="text/html" title="{{ macros::escape_hbs(input=page.title) }}" /> |
20 | | - <published>{{ macros::escape_hbs(input=page.published) }}</published> |
21 | | - <updated>{{ macros::escape_hbs(input=page.updated) }}</updated> |
22 | | - <id>https://blog.rust-lang.org/{{ section.path }}{{ macros::escape_hbs(input=page.path) }}</id> |
23 | | - <content type="html" xml:base="https://blog.rust-lang.org/{{ section.path }}{{ macros::escape_hbs(input=page.path) }}">{{ macros::escape_hbs(input=page.contents) }}</content> |
| 20 | + <title>{{ macros::escape_hbs(input=page.title) | safe }}</title> |
| 21 | + <link rel="alternate" href="https://blog.rust-lang.org{{ section.path | trim_end_matches(pat="/") }}{{ macros::escape_hbs(input=page.path) | safe }}" type="text/html" title="{{ macros::escape_hbs(input=page.title) | safe }}" /> |
| 22 | + {%- set year = page.components[0] | int %} |
| 23 | + {%- set month = page.components[1] | int %} |
| 24 | + {%- set day = page.components[2] | int %} |
| 25 | + <published>{{ year }}-{{ month }}-{{ day }}T00:00:00+00:00</published> |
| 26 | + <updated>{{ year }}-{{ month }}-{{ day }}T00:00:00+00:00</updated> |
| 27 | + <id>https://blog.rust-lang.org{{ section.path | trim_end_matches(pat="/") }}{{ macros::escape_hbs(input=page.path) | safe }}</id> |
| 28 | + <content type="html" xml:base="https://blog.rust-lang.org{{ section.path | trim_end_matches(pat="/") }}{{ macros::escape_hbs(input=page.path) | safe }}">{{ macros::escape_hbs(input=page.content) }}</content> |
24 | 29 |
|
25 | 30 | <author> |
26 | | - <name>{{ macros::escape_hbs(input=page.author) }}</name> |
| 31 | + <name>{{ macros::escape_hbs(input=page.authors | join(sep=", ")) }}</name> |
27 | 32 | </author> |
28 | 33 | </entry> |
29 | 34 | {%- endfor %} |
|
0 commit comments