mirror of https://gitlab.com/curben/blog
56 lines
2.4 KiB
XML
56 lines
2.4 KiB
XML
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
||
|
<title>{{ config.title }}</title>
|
||
|
{% if icon %}<icon>{{ icon }}</icon>{% endif %}
|
||
|
{% if config.subtitle %}<subtitle>{{ config.subtitle }}</subtitle>{% endif %}
|
||
|
<link href="{{ feed_url | uriencode }}" rel="self"/>
|
||
|
{% if config.feed.hub %}<link href="{{ config.feed.hub | uriencode }}" rel="hub"/>{% endif %}
|
||
|
<link href="{{ url | uriencode }}"/>
|
||
|
<updated>{% if posts.first().updated %}{{ posts.first().updated | formatDate }}{% else %}{{ posts.first().date | formatDate }}{% endif %}</updated>
|
||
|
<id>{{ url | uriencode }}</id>
|
||
|
{% if config.author %}
|
||
|
<author>
|
||
|
<name>{{ config.author }}</name>
|
||
|
{% if config.email %}<email>{{ config.email }}</email>{% endif %}
|
||
|
</author>
|
||
|
{% endif %}
|
||
|
<generator uri="https://hexo.io/">Hexo</generator>
|
||
|
{% for post in posts.toArray() %}
|
||
|
<entry>
|
||
|
<title>{{ post.title }}</title>
|
||
|
<link href="{{ post.permalink }}"/>
|
||
|
<id>{{ post.permalink }}</id>
|
||
|
<published>{{ post.date | formatDate }}</published>
|
||
|
<updated>{% if post.updated %}{{ post.updated | formatDate }}{% else %}{{ post.date | formatDate }}{% endif %}</updated>
|
||
|
{% if config.feed.content and post.content %}
|
||
|
<content type="html"><![CDATA[{{ post.content | noControlChars | safe }}]]></content>
|
||
|
{% endif %}
|
||
|
{% if post.description %}
|
||
|
<summary type="html">{{ post.description }}</summary>
|
||
|
{% elif post.intro %}
|
||
|
<summary type="html">{{ post.intro }}</summary>
|
||
|
{% elif post.excerpt %}
|
||
|
<summary type="html">{{ post.excerpt }}</summary>
|
||
|
{% elif post.content %}
|
||
|
{% set short_content = post.content.substring(0, config.feed.content_limit) %}
|
||
|
{% if config.feed.content_limit_delim %}
|
||
|
{% set delim_pos = short_content.lastIndexOf(config.feed.content_limit_delim) %}
|
||
|
{% if delim_pos > -1 %}
|
||
|
<summary type="html">{{ short_content.substring(0, delim_pos) }}</summary>
|
||
|
{% else %}
|
||
|
<summary type="html">{{ short_content }}</summary>
|
||
|
{% endif %}
|
||
|
{% else %}
|
||
|
<summary type="html">{{ short_content }}</summary>
|
||
|
{% endif %}
|
||
|
{% endif %}
|
||
|
{% if post.image %}
|
||
|
<content src="{{ post.image | fullUrlFor }}" type="image" />
|
||
|
{% endif %}
|
||
|
{% for tag in post.tags.toArray() %}
|
||
|
<category term="{{ tag.name }}" scheme="{{ tag.path | fullUrlFor }}"/>
|
||
|
{% endfor %}
|
||
|
</entry>
|
||
|
{% endfor %}
|
||
|
</feed>
|