forked from LeaVerou/lea.verou.me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeed.njk
46 lines (46 loc) · 1.55 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
---json
{
"permalink": "feed.xml",
"layout": null,
"eleventyExcludeFromCollections": true,
"metadata": {
"title": "Lea Verou’s blog",
"subtitle": "Web standards, Software Engineering, Product, Usability, and more",
"language": "en",
"url": "https://lea.verou.me/",
"author": {
"name": "Lea Verou",
"email": "[email protected]"
}
}
}
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="{{ metadata.url }}">
<title>{{ metadata.title }}</title>
<subtitle>{{ metadata.subtitle }}</subtitle>
<link href="{{ permalink | absoluteUrl(metadata.url) }}" rel="self"/>
<link href="{{ metadata.url }}"/>
<updated>{{ collections.blog | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
<id>{{ metadata.url }}</id>
<author>
<name>{{ metadata.author.name }}</name>
<email>{{ metadata.author.email }}</email>
</author>
{%- for post in collections.blog | reverse %}
{%- set absolutePostUrl = post.data.compatUrl | absoluteUrl(metadata.url) -%}
{%- if not post.data.draft and not post.data.unlisted -%}
<entry>
<title>{{ post.data.title }}</title>
<link href="{{ absolutePostUrl }}"/>
<updated>{{ post.date | dateToRfc3339 }}</updated>
{% if post.data.wpid -%}
<id>{{ site.domain }}/?p={{ post.data.wpid }}</id>
{%- else -%}
<id>{{ absolutePostUrl }}</id>
{%- endif %}
<content xml:lang="{{ metadata.language }}" type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
</entry>
{%- endif -%}
{%- endfor %}
</feed>