Skip to content
Open
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
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build_search_index = false
default_language = "en"

generate_feeds = true
feed_filenames = ["atom.xml", "rss.xml"]
feed_filenames = ["atom.xml", "rss.xml","no-twim-rss.xml", "no-twim-atom.xml"]

taxonomies = [
{ name = "author", feed = false, paginate_by = 10 },
Expand Down
41 changes: 41 additions & 0 deletions templates/no-twim-atom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% import "macros/atom.html" as atom %}
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
<title>{{ config.title }}
{%- if term %} - {{ term.name }}
{%- elif section.title %} - {{ section.title }}
{%- endif -%}
</title>
{%- if config.description %}
<subtitle>{{ config.description }}</subtitle>
{%- endif %}
<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
<link href="
{%- if section -%}
{{ section.permalink | escape_xml | safe }}
{%- else -%}
{{ config.base_url | escape_xml | safe }}
{%- endif -%}
"/>
<generator uri="https://www.getzola.org/">Zola</generator>
<updated>{{ last_updated | date(format="%+") }}</updated>
<id>{{ feed_url | safe }}</id>
{% set filtered_pages = [] %}
{% for page in pages %}
{% set path_lower = page.path | lower %}
{% set is_twim = path_lower is containing("twim") or path_lower is containing("this-week-in-matrix") %}
{% if not is_twim %}
{% set_global filtered_pages = filtered_pages | concat(with=page) %}
{% endif %}
{% endfor %}
{% set pageslen = filtered_pages | length %}
{% if pageslen > 15 %}
{% for i in range(end=15) %}
{{ atom::entry(page=filtered_pages[i]) }}
{% endfor %}
{% else %}
{%- for page in filtered_pages %}
{{ atom::entry(page=page) }}
{%- endfor %}
{% endif %}
</feed>
46 changes: 46 additions & 0 deletions templates/no-twim-rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>{{ config.title }}
{%- if term %} - {{ term.name }}
{%- elif section.title %} - {{ section.title }}
{%- endif -%}
</title>
<link>
{%- if section -%}
{{ section.permalink | escape_xml | safe }}
{%- else -%}
{{ config.base_url | escape_xml | safe }}
{%- endif -%}
</link>
<description>{{ config.description }}</description>
<generator>Zola</generator>
<language>{{ lang }}</language>
<atom:link href="{{ feed_url | safe }}" rel="self" type="application/rss+xml"/>
<lastBuildDate>{{ last_updated | date(format="%a, %d %b %Y %H:%M:%S %z") }}</lastBuildDate>
{% for page in pages %}
{% set path_lower = page.path | lower %}
{% set is_twim = path_lower is containing("twim") or path_lower is containing("this-week-in-matrix") %}
{% if not is_twim %}
<item>
<title>{{ page.title }}</title>
<pubDate>{{ page.date | date(format="%a, %d %b %Y %H:%M:%S %z") }}</pubDate>
<author>
{%- if page.taxonomies.author -%}
{%- for author in page.taxonomies.author -%}
{{ author | default(value=["unknown author"]) }}{%- if not loop.last -%}, {% endif -%}
{%- endfor -%}
{%- elif config.author -%}
{{ config.author }}
{%- else -%}
Unknown
{%- endif -%}
</author>
<link>{{ page.permalink | escape_xml | safe }}</link>
<guid>{{ page.permalink | escape_xml | safe }}</guid>
<description>{{ page.content }}</description>
</item>
{% endif %}
{%- endfor %}
</channel>
</rss>