From fdb63c8cb65fab8a59389a01eaf722758c5c0128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar?= <welpo@users.noreply.github.com> Date: Sat, 22 Jun 2024 00:13:32 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(footer):=20show=20feed=20ico?= =?UTF-8?q?n=20on=20Zola=200.19.0=20(#336)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 5 +---- content/_index.ca.md | 1 - content/_index.es.md | 1 - content/_index.md | 1 - content/blog/_index.ca.md | 1 - content/blog/_index.es.md | 1 - content/blog/_index.md | 1 - content/blog/mastering-tabi-settings/index.ca.md | 4 +++- content/blog/mastering-tabi-settings/index.es.md | 4 +++- content/blog/mastering-tabi-settings/index.md | 4 +++- templates/partials/footer.html | 9 +++++++-- theme.toml | 1 + 12 files changed, 18 insertions(+), 15 deletions(-) diff --git a/config.toml b/config.toml index 109a30dbe..fd3332b64 100644 --- a/config.toml +++ b/config.toml @@ -51,8 +51,6 @@ skip_anchor_prefixes = [ title = "~/tabi" description = "tabi es un tema de Zola rápido, liviano y moderno con JavaScript opcional y una puntuación perfecta en Lighthouse." generate_feed = true -compile_sass = true -minify_html = true taxonomies = [{name = "tags", feed = true}] build_search_index = true @@ -60,8 +58,6 @@ build_search_index = true title = "~/tabi" description = "tabi és un tema de Zola ràpid, lleuger i modern amb JavaScript opcional i una puntuació perfecta a Lighthouse." generate_feed = true -compile_sass = true -minify_html = true taxonomies = [{name = "tags", feed = true}] [extra] @@ -217,6 +213,7 @@ menu = [ ] # The RSS icon will be shown if (1) it's enabled and (2) the following variable is set to true. +# Note for Zola 0.19.X users: when `feed_filenames` has two filenames, only the first one will be linked in the footer. feed_icon = true # Show the full post content in the Atom feed. diff --git a/content/_index.ca.md b/content/_index.ca.md index f2c8f8338..ed92599ad 100644 --- a/content/_index.ca.md +++ b/content/_index.ca.md @@ -1,5 +1,4 @@ +++ -path = "/" title = "Publicacions recents" sort_by = "date" template = "section.html" diff --git a/content/_index.es.md b/content/_index.es.md index 2a08b458f..51b9e2b6a 100644 --- a/content/_index.es.md +++ b/content/_index.es.md @@ -1,5 +1,4 @@ +++ -path = "/" title = "Publicaciones recientes" sort_by = "date" template = "section.html" diff --git a/content/_index.md b/content/_index.md index 8fa152a77..fba61723a 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,5 +1,4 @@ +++ -path = "/" title = "Latest posts" sort_by = "date" template = "section.html" diff --git a/content/blog/_index.ca.md b/content/blog/_index.ca.md index 319313910..7a722314c 100644 --- a/content/blog/_index.ca.md +++ b/content/blog/_index.ca.md @@ -1,6 +1,5 @@ +++ paginate_by = 5 -path = "/blog" title = "Blog" sort_by = "date" template = "section.html" diff --git a/content/blog/_index.es.md b/content/blog/_index.es.md index 366dc5293..a367dbbad 100644 --- a/content/blog/_index.es.md +++ b/content/blog/_index.es.md @@ -1,6 +1,5 @@ +++ paginate_by = 5 -path = "/blog" title = "Blog" sort_by = "date" template = "section.html" diff --git a/content/blog/_index.md b/content/blog/_index.md index 6e4c2e95a..036db4df5 100644 --- a/content/blog/_index.md +++ b/content/blog/_index.md @@ -1,6 +1,5 @@ +++ paginate_by = 5 -path = "/blog" title = "Blog" sort_by = "date" template = "section.html" diff --git a/content/blog/mastering-tabi-settings/index.ca.md b/content/blog/mastering-tabi-settings/index.ca.md index a78ffa1b2..b0aa5a45d 100644 --- a/content/blog/mastering-tabi-settings/index.ca.md +++ b/content/blog/mastering-tabi-settings/index.ca.md @@ -1,7 +1,7 @@ +++ title = "Domina la configuració de tabi: guia completa" date = 2023-09-18 -updated = 2024-06-19 +updated = 2024-06-22 description = "Descobreix les múltiples maneres en què pots personalitzar tabi." [taxonomies] @@ -654,6 +654,8 @@ Per utilitzar una icona personalitzada, pots afegir-la al directori `static/soci Pots afegir un enllaç al teu feed RSS/Atom al peu de pàgina amb `feed_icon = true`. +Nota pels usuaris de Zola 0.19.X: quan hi ha dos noms de fitxer a `feed_filenames`, només s'enllaçarà el primer al peu de pàgina. + #### Menú de peu de pàgina | Pàgina | Secció | `config.toml` | Segueix la jerarquia | Requereix JavaScript | diff --git a/content/blog/mastering-tabi-settings/index.es.md b/content/blog/mastering-tabi-settings/index.es.md index 5fc5880ff..ba4b60bbe 100644 --- a/content/blog/mastering-tabi-settings/index.es.md +++ b/content/blog/mastering-tabi-settings/index.es.md @@ -1,7 +1,7 @@ +++ title = "Domina la configuración de tabi: guía completa" date = 2023-09-18 -updated = 2024-06-19 +updated = 2024-06-22 description = "Descubre las múltiples maneras en que puedes personalizar tabi." [taxonomies] @@ -656,6 +656,8 @@ Para usar un icono personalizado, puedes añadirlo al directorio `static/social_ Puedes añadir un enlace a tu feed RSS/Atom en el pie de página con `feed_icon = true`. +Nota para usuarios de Zola 0.19.X: cuando hay dos nombres de archivo en `feed_filenames`, solo se enlazará el primero en el pie de página. + ### Menú de pie de página | Página | Sección | `config.toml` | Respeta jerarquía | Requiere JavaScript | diff --git a/content/blog/mastering-tabi-settings/index.md b/content/blog/mastering-tabi-settings/index.md index 0f187767e..a3ba80e9b 100644 --- a/content/blog/mastering-tabi-settings/index.md +++ b/content/blog/mastering-tabi-settings/index.md @@ -1,7 +1,7 @@ +++ title = "Mastering tabi Settings: A Comprehensive Guide" date = 2023-09-18 -updated = 2024-06-19 +updated = 2024-06-22 description = "Discover the many ways you can customise your tabi site." [taxonomies] @@ -659,6 +659,8 @@ To use a custom icon, you can add it to your site's `static/social_icons` direct You can add a link to your RSS/Atom feed to the footer with `feed_icon = true`. +Note for Zola 0.19.X users: when there are two filenames in `feed_filenames`, only the first one will be linked in the footer. + ### Footer Menu | Page | Section | `config.toml` | Follows Hierarchy | Requires JavaScript | diff --git a/templates/partials/footer.html b/templates/partials/footer.html index 95ea45c69..2dadba31a 100644 --- a/templates/partials/footer.html +++ b/templates/partials/footer.html @@ -13,9 +13,14 @@ <nav class="socials nav-navs"> {%- if config.extra.socials or config.extra.email %} <ul> - {%- if config.generate_feed and config.extra.feed_icon -%} + {# 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 -%} <li> - <a class="nav-links no-hover-padding social" rel="{{ rel_attributes }}" {{ blank_target }} href={{ get_url(path=config.feed_filename, lang=lang, trailing_slash=false) | safe }}> + <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 alt="feed" title="feed" src="{{ get_url(path='/social_icons/rss.svg') }}"> </a> </li> diff --git a/theme.toml b/theme.toml index 863a1274d..fca727be6 100644 --- a/theme.toml +++ b/theme.toml @@ -171,6 +171,7 @@ menu = [ ] # The RSS icon will be shown if (1) it's enabled and (2) the following variable is set to true. +# Note for Zola 0.19.X users: when `feed_filenames` has two filenames, only the first one will be linked in the footer. feed_icon = true # Show the full post content in the Atom feed.