This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
/
feed.xml
executable file
·63 lines (55 loc) · 2.57 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
---
layout: null
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ site.lang }}">
<link href="{{ page.url | absolute_url }}" rel="self" type="application/atom+xml" />
<link href="{{ '/' | absolute_url }}" rel="alternate" type="text/html" hreflang="{{ site.lang }}"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ page.url | absolute_url | xml_escape }}</id>
<title>{{ site.title | strip_html | xml_escape | strip }}</title>
<subtitle>{{ site.description | markdownify | strip_html }}</subtitle>
{% if site.author %}
<author>
<name>{{ site.author.name | default: site.author | xml_escape }}</name>
{% if site.author.email %}
<email>{{ site.author.email | xml_escape }}</email>
{% endif %}
{% if site.author.url %}
<uri>{{ site.author.url | absolute_url | xml_escape }}</uri>
{% endif %}
</author>
{% endif %}
{% assign sorted_posts = site.posts | sort: 'updated_on' | reverse %}
{% for post in sorted_posts limit: 10 %}
<entry>
<title type="html">{{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title>
<link href="{{ post.url | absolute_url }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
<published>{{ post.date | date_to_xmlschema }}</published>
<updated>{{ post.last_revised_on | default: post.date | date_to_xmlschema }}</updated>
<id>{{ post.id | absolute_url | xml_escape }}</id>
<content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}">
{{ post.content | strip | xml_escape }}
</content>
{% assign author = site.authors | where:"name", post.author | first | default: site.author %}
<author>
<name>{{ author.name | default: "" | xml_escape }}</name>
{% if author.email %}
<email>{{ author.email | xml_escape }}</email>
{% endif %}
{% if author.url %}
<uri>{{ author.url | absolute_url | xml_escape }}</uri>
{% endif %}
</author>
{% if post.category and post.category != empty %}
<category term="{{ post.category | xml_escape }}" />
{% endif %}
{% for tag in post.tags %}
<category term="{{ tag | xml_escape }}" />
{% endfor %}
{% if post.excerpt and post.excerpt != empty %}
<summary type="html">{{ post.excerpt | markdownify | normalize_whitespace | xml_escape }}</summary>
{% endif %}
</entry>
{% endfor %}
</feed>