Add support for multiple atom/rss feed files

This commit is contained in:
Brooke 2024-07-22 14:41:53 -07:00
parent be6980def0
commit 2d6d7e6c89
No known key found for this signature in database
GPG key ID: 56C4CCAEB8BD5307

View file

@ -14,12 +14,17 @@
{%- block open_graph %}{{ head_macros::open_graph(config=config) }}{% endblock open_graph -%}
{%- if config.generate_feeds %}
{%- if "rss" in config.feed_filename %}
{% set feed_type = 'rss+xml' %}
{%- else %}
{% set feed_type = 'atom+xml' %}
{% endif -%}
<link rel="alternate" type="application/{{ feed_type }}" title="RSS" href="{{ get_url(path=config.feed_filename) | safe }}">
{%- for feed in config.feed_filenames %}
{%- if feed is containing('atom') %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}
{%- if feed is containing('rss') %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}
{%- endfor %}
{% endif -%}
{%- if config.extra.favicon %}