feat: add hide_from_main_feed support (#490)

This commit is contained in:
Óscar 2025-02-16 09:49:51 +01:00 committed by GitHub
parent 45fe170467
commit 09e724a82b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 6 deletions

View file

@ -1,7 +1,7 @@
+++
title = "Domina la configuració de tabi: guia completa"
date = 2023-09-18
updated = 2025-02-15
updated = 2025-02-16
description = "Descobreix les múltiples maneres en què pots personalitzar tabi."
[taxonomies]
@ -761,7 +761,10 @@ Per defecte, el feed Atom només conté el resum o descripció de les teves publ
|:----:|:-------:|:-------------:|:-----------------:|:-------------------:|
| ✅ | ✅ | ✅ | ✅ | ❌ |
Pots amagar pàgines específiques o seccions senceres del feed amb `hide_from_feed = true`.
Pots controlar com apareix el contingut als feeds utilitzant dues configuracions:
- `hide_from_feed = true`: Amaga el contingut de tots els feeds (feed principal, feeds de secció i feeds d'etiquetes)
- `hide_from_main_feed = true`: Amaga el contingut només del feed principal mentre el manté visible als feeds de secció i d'etiquetes
### Comentaris {#afegir-comentaris}

View file

@ -1,7 +1,7 @@
+++
title = "Domina la configuración de tabi: guía completa"
date = 2023-09-18
updated = 2025-02-15
updated = 2025-02-16
description = "Descubre las múltiples maneras en que puedes personalizar tabi."
[taxonomies]
@ -762,7 +762,10 @@ Por defecto, el feed Atom solo contiene el resumen/descripción de tus publicaci
|:----:|:-------:|:-------------:|:-----------------:|:-------------------:|
| ✅ | ✅ | ✅ | ✅ | ❌ |
Puedes ocultar páginas específicas o secciones enteras del feed con `hide_from_feed = true`.
Puedes controlar cómo aparece el contenido en los feeds usando dos configuraciones:
- `hide_from_feed = true`: Oculta el contenido de todos los feeds (feed principal, feeds de sección y feeds de etiquetas)
- `hide_from_main_feed = true`: Oculta el contenido solo del feed principal mientras lo mantiene visible en los feeds de sección y de etiquetas
### Comentarios {#añadir-comentarios}

View file

@ -1,7 +1,7 @@
+++
title = "Mastering tabi Settings: A Comprehensive Guide"
date = 2023-09-18
updated = 2025-02-15
updated = 2025-02-16
description = "Discover the many ways you can customise your tabi site."
[taxonomies]
@ -770,7 +770,10 @@ By default, the Atom feed only contains the summary/description of your posts. Y
|:----:|:-------:|:-------------:|:-----------------:|:-------------------:|
| ✅ | ✅ | ✅ | ✅ | ❌ |
You can hide specific pages or entire sections from your feed by setting `hide_from_feed = true`.
You can control how content appears in your feeds using two settings:
1. `hide_from_feed = true`: Hides content from all feeds (main, section, and tag feeds)
2. `hide_from_main_feed = true`: Hides content only from the main feed while keeping it visible in section and tag feeds
### Comments {#adding-comments}

View file

@ -72,6 +72,12 @@
{%- if macros_settings::evaluate_setting_priority(setting="hide_from_feed", page=page, default_global_value=false) == "true" -%}
{%- continue -%}
{%- endif -%}
{#- Skip if hide_from_main_feed is true and this is the main feed -#}
{%- if macros_settings::evaluate_setting_priority(setting="hide_from_main_feed", page=page, default_global_value=false) == "true"
and not section
and not term -%}
{%- continue -%}
{%- endif -%}
<entry xml:lang="{{ page.lang }}">
<title>{{ page.title }}</title>
<published>{{ page.date | date(format="%+") }}</published>