From 302fe6b18ed497f661e17b7b7a1fa1a2a5a243db Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev <anwinged@ya.ru> Date: Tue, 30 Jul 2019 21:16:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20atom=20feed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/sculpin_site.yml | 2 ++ source/atom.xml | 30 ++++++++++++++++++++++++++++++ source/robots.txt | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 source/atom.xml diff --git a/app/config/sculpin_site.yml b/app/config/sculpin_site.yml index 4e7f2d2..5f765ed 100644 --- a/app/config/sculpin_site.yml +++ b/app/config/sculpin_site.yml @@ -1,2 +1,4 @@ --- title: Антон Вахрушев +author: Антон Вахрушев +email: anton@vakhrushev.me diff --git a/source/atom.xml b/source/atom.xml new file mode 100644 index 0000000..3555fc3 --- /dev/null +++ b/source/atom.xml @@ -0,0 +1,30 @@ +--- +use: ["articles"] +permalink: none +sitemap: + _exclude: yes +--- +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <title><![CDATA[{{ site.title }}]]></title> + <link href="{{ site.url }}/atom.xml" rel="self"/> + <link href="{{ site.url }}/"/> + <updated>{{ site.calculated_date | date('c') }}</updated> + <id>{{ site.url }}/</id> + {% if site.author or site.email %} + <author> + {% if site.author %}<name><![CDATA[{{ site.author }}]]></name>{% endif %} + {% if site.email %}<email><![CDATA[{{ site.email }}]]></email>{% endif %} + </author> + {% endif %} + <generator uri="http://sculpin.io/">Sculpin</generator> + {% for article in data.articles|slice(0, 10) %} + <entry> + <title type="html"><![CDATA[{{ article.title }}]]></title> + <link href="{{ site.url }}{{ article.url }}"/> + <updated>{{ article.date|date('c') }}</updated> + <id>{{ site.url }}{{ article.url }}</id> + <content type="html"><![CDATA[{{ article.blocks.content|raw }}]]></content> + </entry> + {% endfor %} +</feed> diff --git a/source/robots.txt b/source/robots.txt index f1e84ef..fb5960b 100644 --- a/source/robots.txt +++ b/source/robots.txt @@ -1,7 +1,7 @@ --- permalink: none sitemap: - _exclude: yes + _exclude: yes --- User-agent: * Sitemap: {{ site.url }}/sitemap.xml