-
Notifications
You must be signed in to change notification settings - Fork 92
/
feed.xml
97 lines (84 loc) · 4.41 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
93
94
95
96
---
layout: null
---
<?xml version="1.0" encoding="utf-8"?>
{% comment %}
This file was copied from the default Jekyll Feed template (https://github.com/jekyll/jekyll-feed/blob/master/lib/jekyll-feed/feed.xml).
Links to blog posts have been updated to allow external blog posts to be used.
{% endcomment %}
{% if page.xsl %}
<?xml-stylesheet type="text/xml" href="{{ '/feed.xslt.xml' | absolute_url }}"?>
{% endif %}
<feed xmlns="http://www.w3.org/2005/Atom" {% if site.lang %}xml:lang="{{ site.lang }}"{% endif %}>
<generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
<link href="{{ page.url | absolute_url }}" rel="self" type="application/atom+xml" />
<link href="{{ '/' | absolute_url }}" rel="alternate" type="text/html" {% if site.lang %}hreflang="{{ site.lang }}" {% endif %}/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}{{ site.baseurl }}</id>
{% assign title = site.title | default: site.name %}
{% if title %}
<title type="html">{{ title | smartify | xml_escape }}</title>
{% endif %}
{% for post in site.posts limit:10 %}
<entry>
<title type="html">{{ post.title }}</title>
<link href="{% if post.link %}{{ post.link }}{% else %}{{ post.url | absolute_url }}{% endif %}" rel="alternate" type="text/html" title="{{ post.title }}" />
<published>{{ post.date | date_to_xmlschema }}</published>
<updated>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</updated>
<id>{% if post.link %}{{ post.link }}{% else %}{{ post.id | absolute_url | xml_escape }}{% endif %}</id>
{% assign excerpt_only = post.feed.excerpt_only | default: site.feed.excerpt_only %}
{% unless excerpt_only %}
<content type="html" xml:base="{% if post.link %}{{ post.link }}{% else %}{{ post.url | absolute_url | xml_escape }}{% endif %}">{{ post.content | strip | xml_escape }}</content>
{% endunless %}
{% assign post_authors = "" | split: ',' %}
{% assign post_authors_emails = "" | split: ',' %}
{% assign post_authors_uris = "" | split: ',' %}
{% assign post_authors_names = "" | split: ',' %}
{% for a in post.author %}
{% assign a_data = a | default: site.author %}
{% assign a_data = site.data.authors[a_data] | default: a_data %}
{% assign a_email = a_data.email | default: nil %}
{% assign a_uri = a_data.uri | default: nil %}
{% assign a_name = a_data.name | default: a_data %}
{% assign post_authors = post_authors | push: a_data %}
{% assign post_authors_emails = post_authors_emails | push: a_email %}
{% assign post_authors_uris = post_authors_uris | push: a_uri %}
{% assign post_authors_names = post_authors_names | push: a_name %}
{% endfor %}
{% for i in post_authors %}
<author>
<name>{{ post_authors_names[forloop.index0] | default: "" | xml_escape }}</name>
{% if post_authors_emails[forloop.index0] %}
<email>{{ post_authors_emails[forloop.index0] | xml_escape }}</email>
{% endif %}
{% if post_authors_uris[forloop.index0] %}
<uri>{{ post_authors_uris[forloop.index0] | xml_escape }}</uri>
{% endif %}
</author>
{% endfor %}
{% if post.category %}
<category term="{{ post.category | xml_escape }}" />
{% elsif post.categories %}
{% for category in post.categories %}
<category term="{{ category | xml_escape }}" />
{% endfor %}
{% endif %}
{% for tag in post.tags %}
<category term="{{ tag | xml_escape }}" />
{% endfor %}
{% if post.excerpt and post.excerpt != empty %}
<summary type="html">{{ post.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary>
{% elsif post.synopsis %}
<summary type="html">{{ post.synopsis | strip_html | normalize_whitespace | xml_escape }}</summary>
{% endif %}
{% assign post_image = post.image.path | default: post.image %}
{% if post_image %}
{% unless post_image contains "://" %}
{% assign post_image = post_image | absolute_url %}
{% endunless %}
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ post_image | xml_escape }}" />
<media:content medium="image" url="{{ post_image | xml_escape }}" xmlns:media="http://search.yahoo.com/mrss/" />
{% endif %}
</entry>
{% endfor %}
</feed>