Adds posts categories to RSS feeds and Blog categories to the Atom one

This commit is contained in:
Samuel FORESTIER 2020-03-17 19:38:35 +01:00
parent 5e4ef1eb04
commit e7742d8d1b
2 changed files with 9 additions and 1 deletions

@ -13,6 +13,12 @@ regenerate: true
<uri>{{ site.author.url | xml_escape }}</uri>
</author>
<link rel="self" href="{{ site.url }}/atom.xml" type="application/atom+xml"/>
{%- for category in site.categories %}
<category
term="{{ category[0] | downcase | xml_escape }}"
scheme="/blog/{{ category[0] | downcase | xml_escape }}"
label="{{ category[0] | xml_escape }}"/>
{% endfor %}
<generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
<rights>All rights reserved {{ site.author.name }} {{ site.posts.last.date | date: "%Y" }} - {{ "now" | date: "%Y" }}</rights>
<subtitle>{{ site.description | xml_escape }}</subtitle>
@ -25,6 +31,7 @@ regenerate: true
<updated>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</updated>
<link rel="alternate" type="text/html" href="{{ site.url }}{{ post.url }}"/>
<summary>{{ post.description | xml_escape }}</summary>
<category term="{{ post.category | downcase | xml_escape }}"/>
<published>{{ post.date | date_to_xmlschema }}</published>
</entry>
{%- endunless %}

@ -26,7 +26,8 @@ regenerate: true
"name": {{ site.author.name | jsonify }}
},
"content_html": "",
"summary": {{ post.description | jsonify }}
"summary": {{ post.description | jsonify }},
"tags": [{{ post.category | jsonify }}]
}{% unless forloop.last %},{% endunless %}{% endunless %}{% endfor %}
]
}