-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfeed.xml
92 lines (74 loc) · 2.8 KB
/
feed.xml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
---
{%- comment -%}
This custom XML file replaces that produced by the built-in jekyll-feed
plugin. You may still see the jekyll-feed plugin do its thing during site
build because it is part of the minima theme, but the feed rendered by this
file is the one that gets included in the end.
References:
- https://gist.github.com/andrewstiefel/57a0a400aa2deb6c9fe18c6da4e16e0f
- https://www.roboleary.net/webdev/2022/06/14/how-i-fixed-the-atom-web-feed-on-my-website.html
{%- endcomment -%}
{%- comment -%}
Date format used in the <readableDate> field below
{%- endcomment -%}
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="/feed.xsl" type="text/xsl"?>
<!--
This XML template is based on one by Andrew Stiefel:
https://gist.github.com/andrewstiefel/57a0a400aa2deb6c9fe18c6da4e16e0f
-->
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text">
{{- site.title | strip_html | normalize_whitespace | xml_escape -}}
</title>
<link href="{{ site.url }}{{ site.baseurl }}/feed.xml" rel="self" />
<link href="{{ site.url }}{{ site.baseurl }}/" rel="alternate" />
<subtitle type="text">
{{- site.description | strip_html | normalize_whitespace | xml_escape -}}
</subtitle>
<updated>
{{- site.time | date_to_xmlschema -}}
</updated>
<id>{{ site.url }}/</id>
<author>
<name>
{{- site.author | strip_html | normalize_whitespace | xml_escape -}}
</name>
<email>
{{- site.email | strip_html | normalize_whitespace | xml_escape -}}
</email>
</author>
<rights type="text">Creative Commons CC BY-SA 4.0 license</rights>
{% for post in site.posts %}
{%- if post.hidden -%}
{%- continue -%}
{%- endif -%}
<entry>
<title type="text">{{ post.title | strip_html | normalize_whitespace }}</title>
<link rel="alternate" href="{{ site.url }}{{ post.url }}" />
<!--
Use post.date as both the updated and published date. Currently, we don't
keep separate track of when a post was updated.
-->
<updated>{{ post.date | date_to_xmlschema }}</updated>
<published>{{ post.date | date_to_xmlschema }}</published>
<!--
An RFC 4287 Simple Extension element: human-readable representation of the
publication date. We use this in the stylesheet to show a concise date
instead of the dense ISO format string.
-->
<readableDate>
{{- post.date | date: date_format | xml_escape -}}
</readableDate>
<id>{{ site.url }}{{ site.baseurl }}{{ post.id }}</id>
<summary type="html">
{{- post.excerpt | strip | normalize_whitespace | xml_escape -}}
</summary>
<content type="html">
{{- post.content | strip | normalize_whitespace | xml_escape -}}
</content>
</entry>
{% endfor %}
</feed>