-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeed.xml
88 lines (88 loc) · 4.35 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
---
layout: null
---
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="/feed.xsl" type="text/xsl"?>
{%- comment -%}{% if page.xsl %}
<?xml-stylesheet type="text/xml" href="{{ '/feed.xslt.xml' | absolute_url }}"?>
{% endif %}{%- endcomment -%}
<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="{{ site.url | absolute_url }}" rel="alternate" type="text/html" {% if site.lang %}hreflang="{{ site.lang }}" {% endif %}/>
<updated>{{ site.time | date: "%-m/%-d/%Y" }}</updated>
<id>{{ site.url | absolute_url | xml_escape }}</id>
<title type="html">{{ site.name | xml_escape }}</title>
{%- if site.description and site.description != '' -%}
<subtitle>{{ site.description | xml_escape }}</subtitle>
{%- endif -%}
{%- comment -%}
{% 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.uri %}
<uri>{{ site.author.uri | xml_escape }}</uri>
{% endif %}
</author>
{% endif %}
{%- endcomment -%}
{% for post in site.posts %}
{% assign current_date = site.time | date: "%Y-%m-%d %H:%M" %}
{% assign post_expiration = post.expire_date | date: "%Y-%m-%d %H:%M" %}
{% assign current_posts = site.posts | where_exp: "item", "item.expire_date > site.time" %}
{%- endfor -%}
{%- assign posts = current_posts | where_exp: "post", "post.draft != true" -%}
{% for post in posts limit: 10 %}
<entry{% if post.lang %}{{" "}}xml:lang="{{ post.lang }}"{% endif %}>
{% assign post_title = post.title | replace: '"', '"' | replace: ' & ', ' and ' -%}
{% assign post_title_attr = post.title | remove: '"' | replace: ' & ', ' and ' | xml_escape -%}
<title type="html">{{ post_title | strip_html | normalize_whitespace }}</title>
<link href="{{ post.url | absolute_url }}" rel="alternate" type="text/html" title="{{ post_title_attr | strip_html | normalize_whitespace }}" />
<published>{{ post.date | date: "%-m/%-d/%Y" }}</published>
<updated>{{ post.date | date: "%-m/%-d/%Y" }}</updated>
<id>{{ post.id | absolute_url | xml_escape }}</id>
{%- comment -%}<content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}">{{ post.content | strip_html | normalize_whitespace | xml_escape }}</content>{%- endcomment -%}
{%- assign post_author = post.author | default: post.authors[0] | default: site.author -%}
{%- assign post_author = site.data.authors[post_author] | default: post_author -%}
{%- assign post_author_email = post_author.email | default: nil -%}
{%- assign post_author_uri = post_author.uri | default: nil -%}
{%- assign post_author_name = post_author.name | default: post_author -%}
{%- comment -%}
<author>
<name>{{ post_author_name | default: "" | xml_escape }}</name>
{% if post_author_email %}
<email>{{ post_author_email | xml_escape }}</email>
{% endif %}
{% if post_author_uri %}
<uri>{{ post_author_uri | xml_escape }}</uri>
{% endif %}
</author>
{%- endcomment -%}
{%- if post.category -%}
<category term="{{ post.category | xml_escape }}" />
{% endif %}
{%- for tag in post.tags -%}
<category term="{{ tag | xml_escape }}" />
{% endfor %}
{%- assign lead = post.article_lead -%}
{%- if lead contains "&" -%}
{% assign lead_no_amp = lead | replace: "&", "and" %}
{% assign lead_escape = lead_no_amp | strip_html | normalize_whitespace | xml_escape %}
<summary type="html">{{ lead_escape }}</summary>
{% else %}
<summary type="html">{{ post.article_lead | 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 }}" />
<thumbnail>{{ post_image | xml_escape }}</thumbnail>
{% endif -%}
</entry>
{%- endfor -%}
</feed>