-
Notifications
You must be signed in to change notification settings - Fork 1
/
feed.njk
52 lines (51 loc) · 1.92 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.xml
eleventyExcludeFromCollections: true
metadata:
title: "Piet van Zoen"
description: "Hi, I'm Piet. I build things for the web. I love all things command line, and fries with mayo. This is a feed."
author:
name: "Piet van Zoen"
email: [email protected]
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ metadata.title }}</title>
<subtitle>{{ metadata.description }}</subtitle>
{% set absoluteUrl %}{{ permalink | url | absoluteUrl(site.url) }}{% endset %}
<link href="{{ absoluteUrl }}" rel="self"/>
<link href="{{ site.url }}"/>
<updated>{{ collections.notes | rssLastUpdatedDate }}</updated>
<id>{{ site.url }}/</id>
<author>
<name>{{ metadata.author.name }}</name>
<uri>{{ site.url }}</uri>
<email>{{ metadata.author.email }}</email>
</author>
{%- for post in collections.notes | reverse %}
{% set absolutePostUrl %}{{ post.url | url | absoluteUrl(site.url) }}{% endset %}
<entry>
<title>{{ post.data.title }}</title>
<link href="{{ absolutePostUrl }}"/>
<author>
<name>{{ metadata.author.name }}</name>
<uri>{{ site.url }}</uri>
<email>{{ metadata.author.email }}</email>
</author>
<published>{{ post.date | rssDate }}</published>
{%- if post.data.updated %}
<updated>{{ post.data.updated | rssDate }}</updated>
{%- else -%}
<updated>{{ post.date | rssDate }}</updated>
{%- endif -%}
<id>{{ absolutePostUrl }}</id>
<rights type="html">&copy; {{ site.buildTime | date('YYYY') }} Piet van Zoen</rights>
{%- if post.data.excerpt %}
<summary>{{ post.data.excerpt | markdown | striptags | trim }}</summary>
{%- elif post.data.preview -%}
<summary>{{ post.data.preview | markdown | striptags | trim }}</summary>
{%- endif -%}
<content type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
</entry>
{%- endfor %}
</feed>