Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ module.exports = function(eleventyConfig) {
});

// Liquid filter to convert a date to a string
eleventyConfig.addLiquidFilter("to_utc_string", date => date.toUTCString() );

// Liquid filter for long date string
eleventyConfig.addLiquidFilter("date_to_long_string", function(date) {
Expand Down
21 changes: 9 additions & 12 deletions navigation_and_indexes/rss.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,32 @@ permalink: /rss.xml
theme:
name: orionrobots
---
{% capture BASE_PATH %}{{ site.production_url }}{% endcapture %}
{% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ theme.name }}{% endcapture %}
{%- capture BASE_PATH %}{{ site.production_url }}{% endcapture -%}
{% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ theme.name }}{% endcapture -%}
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>{{ site.title }}</title>
<description>{{ site.title }} - {{ site.tagline }}</description>
<link>{{ site.production_url }}{{ JB.rss_path }}</link>
<link>{{ site.production_url }}</link>
<language>en-gb</language>
<lastBuildDate>{{ now | date_to_long_string }}</lastBuildDate>
<pubDate>{{ time }}</pubDate>
<lastBuildDate>{{ now | to_utc_string }}</lastBuildDate>
<pubDate>{{ now | to_utc_string }}</pubDate>
<ttl>1800</ttl>
<image>
<url>{{ ASSET_PATH }}/images/social-banner.jpg</url>
<title>{{ site.title }}</title>
<link>{{ site.production_url }}</link>
</image>

{% assign posts = collections.all | reverse | with_explicit_date %}
{% for post in posts %}
{%- assign posts = collections.all | reverse | with_explicit_date -%}
{%- for post in posts -%}
<item>
<title>{{ post.title }}</title>
<title>{{ post.data.title }}</title>
<description>{{ post | excerpt | strip_html }}</description>
<link>{{ site.production_url }}{{ post.url }}</link>
<guid>{{ site.production_url }}{{ post.url }}</guid>
<pubDate>{{ post.date }}</pubDate>
<pubDate>{{ post.date | to_utc_string }}</pubDate>
</item>
{% endfor %}

{%- endfor -%}
</channel>
</rss>