Compare commits

...

5 commits

Author SHA1 Message Date
Sandro Stikić cde5c2b82d
Merge 3abae6b153 into 7f630a4e31 2024-08-17 17:58:19 +02:00
Paweł Romanowski 7f630a4e31
Merge pull request #73 from pawroman/tweak-config-for-new-rss
Tweak default config to follow RSS generation changes after Zola 0.19
2024-08-17 17:49:29 +02:00
Paweł Romanowski 26ab720d51 Tweak default config to reflect changes in RSS generation after Zola 0.19 changes 2024-08-17 17:48:30 +02:00
Paweł Romanowski dbef3fa69a
Merge pull request #71 from heitorPB/feeds
templates/index: fix broken RSS/ATOM feed rel links
2024-08-17 17:34:32 +02:00
Heitor Pascoal de Bittencourt d0bb9da1d1
templates/index: fix broken RSS/ATOM feed rel links
Zola 0.19.0 changed the config options related to RSS/ATOM feed
generation, allowing multiple feeds at once. This patch addresses this
change and adds as many links in the HTML head as there are feeds.

Fix #64
2024-08-12 16:36:10 -03:00
3 changed files with 17 additions and 11 deletions

View file

@ -9,7 +9,9 @@
See the live demo (of the default configuration) here:
https://pawroman.github.io/zola-theme-terminimal/
Tested with Zola v0.17.2. Please note that earlier versions might not work because of breaking changes across Zola versions.
Tested with Zola v0.19.2.
Please note that earlier (and older) versions might not work because of breaking changes across Zola versions.
<!-- omit from toc -->
#### Fork disclaimer

View file

@ -6,10 +6,10 @@ title = "Zola Terminimal theme"
compile_sass = true
# The theme supports feeds (RSS and ATOM)
generate_feed = true
generate_feeds = true
# Use `rss.xml` for RSS feeds and `atom.xml` for ATOM.
feed_filename = "atom.xml"
feed_filenames = ["rss.xml", "atom.xml"]
# Optional: enable tags
taxonomies = [

View file

@ -13,14 +13,18 @@
{%- block open_graph %}{{ head_macros::open_graph(config=config) }}{% endblock open_graph -%}
{%- if config.generate_feed %}
{%- 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 }}">
{% endif -%}
{%- if config.generate_feeds %}
{%- 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 %}
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") | safe }}" href="{{ config.extra.favicon | safe }}">