Skip to content

Commit

Permalink
🐛 fix: show feed icon without socials
Browse files Browse the repository at this point in the history
Previously the feed icon would not display when it was the only
configured "social" option, as the containing <ul> required either
socials or email to be present.

Fixes #456
  • Loading branch information
welpo committed Jan 4, 2025
1 parent 28fe074 commit de6fa58
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions templates/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@
{%- set blank_target = "" -%}
{%- endif -%}

{#- Feed icon -#}
{#- Zola 0.19.0 uses `generate_feeds`. Prior versions use `generate_feed` -#}
{%- set generate_feed = config.generate_feeds | default(value=config.generate_feed) -%}
{%- set feed_url = config.feed_filenames[0] | default(value=(config.feed_filename)) -%}
{%- set should_show_feed = generate_feed and config.extra.feed_icon and feed_url -%}

{%- set should_show_footer_icons = should_show_feed or config.extra.socials or config.extra.email -%}

<footer>
<section>
<nav class="socials nav-navs">
{%- if config.extra.socials or config.extra.email %}
{%- if should_show_footer_icons -%}
<ul>
{# Feed icon #}
{# Zola 0.19.0 uses `generate_feeds`. Prior versions use `generate_feed` #}
{% set generate_feed = config.generate_feeds | default(value=config.generate_feed) %}
{% set feed_url = config.feed_filenames[0] | default(value=(config.feed_filename)) %}

{%- if generate_feed and config.extra.feed_icon and feed_url -%}
{%- if should_show_feed -%}
<li>
<a class="nav-links no-hover-padding social" rel="{{ rel_attributes }}" {{ blank_target }} href="{{ get_url(path=feed_url, lang=lang, trailing_slash=false) | safe }}">
<img loading="lazy" alt="feed" title="feed" src="{{ get_url(path='/social_icons/rss.svg') }}">
Expand Down

0 comments on commit de6fa58

Please sign in to comment.