Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix(header): render feed links based on config #358

Merged
merged 1 commit into from
Jul 24, 2024
Merged
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
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