Skip to content

Commit 2666e3c

Browse files
authored
Create feed.xml
1 parent 2791d31 commit 2666e3c

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎feed.xml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
layout: null
3+
permalink: /feed.xml
4+
---
5+
{% assign feed_url = page.url | absolute_url %}<?xml version="1.0" encoding="utf-8"?>
6+
<feed xmlns="http://www.w3.org/2005/Atom">
7+
<title>{{ site.title }}</title>
8+
<subtitle>By {{ site.author.name }}</subtitle>
9+
<link rel="alternate" type="text/html" href="{{ site.url }}" />
10+
<link rel="self" type="application/atom+xml" href="{{ feed_url }}" />
11+
<id>{{ feed_url }}</id>
12+
<updated>{{ site.posts[0].date | date_to_xmlschema }}</updated>
13+
<rights>Copyright © {{ 'now' | date: "%Y" }}, {{ site.author.name }}</rights>
14+
{% assign posts = site.posts | where_exp: "post", "post.draft != true" %} {% for post in posts limit: 50 %} {% if post.feed == true %}
15+
<entry>
16+
<title>{{ post.title }}</title>
17+
<link rel="alternate" type="text/html" href="{{ post.external_url | default: post.permalink | absolute_url }}" />
18+
<link rel="related" type="text/html" href="{{ post.permalink | absolute_url }}" />
19+
<id>{{ post.permalink | absolute_url }}</id>
20+
<published>{{ post.date | date_to_xmlschema }}</published>
21+
<updated>{{ post.update_date | default: post.date | date_to_xmlschema }}</updated>
22+
<author>
23+
<name>{{ post.author.name }}</name>
24+
<uri>{{ post.author.uri | default: site.url }}</uri>
25+
</author>
26+
<content type="html" xml:base="{{ site.url }}" xml:lang="en">
27+
<![CDATA[
28+
{{ post.content }}
29+
]]>
30+
</content>
31+
</entry>{% endif %}{% endfor %}
32+
</feed>

0 commit comments

Comments
 (0)