Skip to content

Commit

Permalink
🐛 fix(header): render feed links based on config (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo authored Jul 24, 2024
1 parent c7b7955 commit 24896a5
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions templates/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,25 @@
<link rel=icon href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 55"><text y=".7em" font-size="82">{{ config.extra.favicon_emoji }}</text></svg>'>
{% endif %}

{# Feed #}
<link rel="alternate" type="application/atom+xml" title="{{ config.title | safe }}" href="{{ get_url(path="atom.xml",
trailing_slash=false) }}">
{# Feeds #}
{% if config.generate_feeds | default(value=config.generate_feed) %}
{% if config.feed_filenames %}
{# Zola 0.19 and newer #}
{% for feed in config.feed_filenames %}
{% if feed == "atom.xml" %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title | safe }} - Atom Feed" href="{{ get_url(path=feed, trailing_slash=false) | safe }}">
{% elif feed == "rss.xml" %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title | safe }} - RSS Feed" href="{{ get_url(path=feed, trailing_slash=false) | safe }}">
{% else %}
<link rel="alternate" href="{{ get_url(path=feed, trailing_slash=false) | safe }}">
{% endif %}
{% endfor %}
{% else %}
{# Older Zola versions #}
{% set feed_url = config.feed_filename | default(value="atom.xml") %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title | safe }}" href="{{ get_url(path=feed_url, trailing_slash=false) | safe }}">
{% endif %}
{% endif %}

{# CSS #}
{# Load subset of glyphs for header. Avoids flashing issue in Firefox #}
Expand Down

0 comments on commit 24896a5

Please sign in to comment.