forked from GoogleChrome/developer.chrome.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeed.njk
52 lines (52 loc) · 1.65 KB
/
feed.njk
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
---
permalink: '{{feed.permalink}}'
disable_algolia: true
pagination:
data: collections.feeds
size: 1
alias: feed
resolve: values
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
{% set absoluteFeedUrl %}{{ site.url }}{% if feed.url %}{{ feed.url | url }}{% endif %}{% endset %}
<title>{{ site.title }}{% if feed.title %} - {{ feed.title }}{% endif %}</title>
<subtitle>{{ feed.description or site.description }}</subtitle>
<link href="{{ site.url }}{{ feed.permalink | url }}" rel="self"/>
<link href="{{ absoluteFeedUrl }}" />
{% if feed.items and feed.items.length %}
<updated>{{ feed.items | rssLastUpdatedDate }}</updated>
{% endif %}
<id>{{ absoluteFeedUrl }}</id>
<author>
<name>{{ site.title }}</name>
</author>
{% for item in feed.items %}
{% set absolutePostUrl %}{{ site.url }}{{ item.url | url }}{% endset %}
<entry>
<title>{{ item.data.title }}</title>
<link href="{{ absolutePostUrl }}" />
<updated>{{ item.date | rssDate }}</updated>
<id>{{ absolutePostUrl }}</id>
{% if item.data.authors.length %}
{% for authorId in item.data.authors %}
{% set authorTitle = 'i18n.authors.' + authorId + '.title' %}
<author>
<name>
{%- if author -%}
{{ authorTitle | i18n(locale) }}
{%- else -%}
{{ authorId }}
{%- endif -%}
</name>
</author>
{% endfor %}
{% else %}
<author>
<name>{{ site.title }}</name>
</author>
{% endif %}
<content type="html">{{ item.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
</entry>
{% endfor %}
</feed>