From a6ae95d8bd0e9a933160fed6381b215d19d817ee Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 5 Feb 2020 22:05:04 -0300 Subject: DIY Atom feed --- _includes/feed.atom | 97 ++++++++++------------------------------------------- 1 file changed, 18 insertions(+), 79 deletions(-) (limited to '_includes') diff --git a/_includes/feed.atom b/_includes/feed.atom index 4d4fd16..f4243ea 100644 --- a/_includes/feed.atom +++ b/_includes/feed.atom @@ -1,96 +1,35 @@ - -{% if page.xsl %} - -{% endif %} - - Jekyll + + - + {{ site.time | date_to_xmlschema }} {{ page.url | absolute_url | xml_escape }} - {% assign title = site.title | default: site.name %} - {% if page.collection != "posts" %} - {% assign collection = page.collection | capitalize %} - {% assign title = title | append: " | " | append: collection %} - {% endif %} - {% if page.category %} - {% assign category = page.category | capitalize %} - {% assign title = title | append: " | " | append: category %} - {% endif %} + {{ site.title | smartify | xml_escape }} + {{ site.t.feed_title[include.lang] | smartify | xml_escape }} - {% if title %} - {{ title | smartify | xml_escape }} - {% endif %} + + {{ site.author.name | xml_escape }} + {{ site.author.email | xml_escape }} + - {% if site.description %} - {{ site.description | xml_escape }} - {% endif %} - - {% if site.author %} - - {{ site.author.name | default: site.author | xml_escape }} - {% if site.author.email %} - {{ site.author.email | xml_escape }} - {% endif %} - {% if site.author.uri %} - {{ site.author.uri | xml_escape }} - {% endif %} - - {% endif %} - - {% assign posts = site[page.collection] | where_exp: "post", "post.draft != true" | sort: "date" | reverse %} - {% if page.category %} - {% assign posts = posts | where: "category",page.category %} - {% endif %} - {% for post in posts limit: 10 %} - + {% assign posts = site.posts | where:"lang", include.lang | sort: "date" | reverse %} + {% for post in posts %} + {{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }} {{ post.date | date_to_xmlschema }} - {{ post.last_modified_at | default: post.date | date_to_xmlschema }} - {{ post.id | absolute_url | xml_escape }} - {% assign excerpt_only = post.feed.excerpt_only | default: site.feed.excerpt_only %} - {% unless excerpt_only %} - {{ post.content | strip | xml_escape }} - {% endunless %} + {{ post.updated_at | default: post.date | date_to_xmlschema }} + {{ post.url | absolute_url | xml_escape }} - {% 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 %} + {{ post.content | strip | xml_escape }} - {{ post_author_name | default: "" | xml_escape }} - {% if post_author_email %} - {{ post_author_email | xml_escape }} - {% endif %} - {% if post_author_uri %} - {{ post_author_uri | xml_escape }} - {% endif %} + {{ site.author.name | xml_escape }} + {{ site.author.email | xml_escape }} - {% if post.category %} - - {% endif %} - - {% for tag in post.tags %} - - {% endfor %} - - {% if post.excerpt and post.excerpt != empty %} - {{ post.excerpt | strip_html | normalize_whitespace | xml_escape }} - {% 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 %} - - - {% endif %} + {{ post.excerpt | strip_html | normalize_whitespace | xml_escape }} {% endfor %} -- cgit v1.2.3