🐛 fix: show feed icon without socials

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
main
welpo 2 months ago
parent 28fe074ea0
commit de6fa58fe3
No known key found for this signature in database
GPG Key ID: A2F978CF4EC1F5A6

@ -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') }}">

Loading…
Cancel
Save