From 920aa609f0b58dcdccec74be4ea74e01cc0b55c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Fern=C3=A1ndez?= Date: Mon, 4 Dec 2023 23:27:49 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(feed):=20support=20hiding=20pa?= =?UTF-8?q?ges=20and=20sections=20(#227)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/blog/mastering-tabi-settings/index.ca.md | 10 +++++++++- content/blog/mastering-tabi-settings/index.es.md | 10 +++++++++- content/blog/mastering-tabi-settings/index.md | 10 +++++++++- content/pages/_index.ca.md | 3 +++ content/pages/_index.es.md | 3 +++ content/pages/_index.md | 3 +++ templates/atom.xml | 4 ++++ 7 files changed, 40 insertions(+), 3 deletions(-) diff --git a/content/blog/mastering-tabi-settings/index.ca.md b/content/blog/mastering-tabi-settings/index.ca.md index 160ae4b..252ae39 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 = 2023-11-24 +updated = 2023-12-04 description = "Descobreix les múltiples maneres en què pots personalitzar tabi." [taxonomies] @@ -442,6 +442,14 @@ Per obtenir més informació, incloent instruccions sobre com crear un subconjun Per defecte, el feed Atom només conté el resum o descripció de les teves publicacions. Pots incloure el contingut complet de les publicacions establint `full_content_in_feed = true` a `config.toml`. +### Amagar contingut del feed + +| Pàgina | Secció | `config.toml` | Segueix la jerarquia | Requereix JavaScript | +|:----:|:-------:|:-------------:|:-----------------:|:-------------------:| +| ✅ | ✅ | ✅ | ✅ | ❌ | + +Pots amagar pàgines específiques o seccions senceres del feed amb `hide_from_feed = true`. + ### Comentaris {#afegir-comentaris} | 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 8f95c64..eca7536 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 = 2023-11-24 +updated = 2023-12-04 description = "Descubre las múltiples maneras en que puedes personalizar tabi." [taxonomies] @@ -440,6 +440,14 @@ Para obtener más información, incluyendo instrucciones sobre cómo crear un su Por defecto, el feed Atom solo contiene el resumen/descripción de tus publicaciones. Puedes incluir el contenido completo de las publicaciones estableciendo `full_content_in_feed = true` en `config.toml`. +### Ocultar contenido del feed + +| Página | Sección | `config.toml` | Sigue la jerarquía | Requiere JavaScript | +|:----:|:-------:|:-------------:|:-----------------:|:-------------------:| +| ✅ | ✅ | ✅ | ✅ | ❌ | + +Puedes ocultar páginas específicas o secciones enteras del feed con `hide_from_feed = true`. + ### Comentarios {#añadir-comentarios} | Página | Sección | `config.toml` | Sigue la jerarquía | Requiere JavaScript | diff --git a/content/blog/mastering-tabi-settings/index.md b/content/blog/mastering-tabi-settings/index.md index 34778cb..328e5ae 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 = 2023-11-24 +updated = 2023-12-04 description = "Discover the many ways you can customise your tabi site." [taxonomies] @@ -444,6 +444,14 @@ For more information, including instructions on how to create a custom subset, s By default, the Atom feed only contains the summary/description of your posts. You can include the entire posts' content by setting `full_content_in_feed = true` in `config.toml`. +### Hiding Content from Feed + +| Page | Section | `config.toml` | Follows Hierarchy | Requires JavaScript | +|:----:|:-------:|:-------------:|:-----------------:|:-------------------:| +| ✅ | ✅ | ✅ | ✅ | ❌ | + +You can hide specific pages or entire sections from your feed by setting `hide_from_feed = true`. + ### Comments {#adding-comments} | Page | Section | `config.toml` | Follows Hierarchy | Requires JavaScript | diff --git a/content/pages/_index.ca.md b/content/pages/_index.ca.md index 6d23e86..927d16f 100644 --- a/content/pages/_index.ca.md +++ b/content/pages/_index.ca.md @@ -1,4 +1,7 @@ +++ render = false insert_anchor_links = "left" + +[extra] +hide_from_feed = true +++ diff --git a/content/pages/_index.es.md b/content/pages/_index.es.md index 6d23e86..927d16f 100644 --- a/content/pages/_index.es.md +++ b/content/pages/_index.es.md @@ -1,4 +1,7 @@ +++ render = false insert_anchor_links = "left" + +[extra] +hide_from_feed = true +++ diff --git a/content/pages/_index.md b/content/pages/_index.md index 6d23e86..927d16f 100644 --- a/content/pages/_index.md +++ b/content/pages/_index.md @@ -1,4 +1,7 @@ +++ render = false insert_anchor_links = "left" + +[extra] +hide_from_feed = true +++ diff --git a/templates/atom.xml b/templates/atom.xml index b2f31bc..10824dc 100644 --- a/templates/atom.xml +++ b/templates/atom.xml @@ -1,4 +1,5 @@ {%- import "macros/translate.html" as macros_translate -%} +{%- import "macros/settings.html" as macros_settings -%} {#- Load the internationalisation data -#} {%- set language_strings = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} {%- if not language_strings -%} @@ -44,6 +45,9 @@ {{ last_updated | date(format="%+") }} {{ feed_url | safe }} {%- for page in pages %} + {%- if macros_settings::evaluate_setting_priority(setting="hide_from_feed", page=page, default_global_value=false) == "true" -%} + {%- continue -%} + {%- endif -%} {{ page.title }} {{ page.date | date(format="%+") }}