From da0c608743b3e92e2e82705a068375888bac1f00 Mon Sep 17 00:00:00 2001 From: lexi Date: Mon, 21 Mar 2022 05:17:16 +0000 Subject: [PATCH] Fix Atom feed multi-author formatting (#744) Signed-off-by: Daniel Gray --- _config.yml | 1 - feed.xml | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 feed.xml diff --git a/_config.yml b/_config.yml index 92ea08d1..f17f3676 100644 --- a/_config.yml +++ b/_config.yml @@ -31,7 +31,6 @@ kramdown: # Build settings plugins: - - jekyll-feed - jekyll-brotli - jekyll-sitemap exclude: [privacytools.io/] diff --git a/feed.xml b/feed.xml new file mode 100644 index 00000000..4b4f1297 --- /dev/null +++ b/feed.xml @@ -0,0 +1,106 @@ +--- +layout: null +collection: posts +--- + + +{% if page.xsl %} + +{% endif %} + + + + {{ 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 %} + + {% if title %} + {{ title | smartify | xml_escape }} + {% endif %} + + {% 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 %} + + {% if page.tags %} + {% assign posts = site.tags[page.tags] %} + {% else %} + {% assign posts = site[page.collection] %} + {% endif %} + {% if page.category %} + {% assign posts = posts | where: "categories", page.category %} + {% endif %} + {% unless site.show_drafts %} + {% assign posts = posts | where_exp: "post", "post.draft != true" %} + {% endunless %} + {% assign posts = posts | sort: "date" | reverse %} + {% assign posts_limit = site.feed.posts_limit | default: 10 %} + {% for post in posts limit: posts_limit %} + + {% assign post_title = post.title | smartify | strip_html | normalize_whitespace | xml_escape %} + + {{ post_title }} + + {{ 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 %} + + {% endunless %} + + {% for author in post.author %} + + {{ author | xml_escape }} + + {% endfor %} + + {% if post.category %} + + {% elsif post.categories %} + {% for category in post.categories %} + + {% endfor %} + {% endif %} + + {% for tag in post.tags %} + + {% endfor %} + + {% assign post_summary = post.description | default: post.excerpt %} + {% if post_summary and post_summary != empty %} + + {% 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 %} + + {% endfor %} + \ No newline at end of file