feat: allow showcasing featured projects on homepage (#297)

This commit is contained in:
Óscar
2024-04-23 17:59:35 +02:00
committed by GitHub
parent 7ef74a8f53
commit e7172a0432
28 changed files with 174 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
+++
title = "Domina la configuració de tabi: guia completa"
date = 2023-09-18
updated = 2024-03-15
updated = 2024-04-23
description = "Descobreix les múltiples maneres en què pots personalitzar tabi."
[taxonomies]
@@ -99,6 +99,8 @@ La [pàgina principal](/) d'aquesta demo té una capçalera amb una imatge, un t
{{ dual_theme_image(light_src="blog/mastering-tabi-settings/img/header_light.webp", dark_src="blog/mastering-tabi-settings/img/header_dark.webp", alt="Capçalera de la pàgina principal") }}
#### Capçalera
Per configurar la imatge i el títol, pots utilitzar la variable `header` al front matter de l'arxiu `_index.md` de la secció. Per exemple:
```toml
@@ -108,6 +110,8 @@ header = {title = "Hola! Soc tabi~", img = "img/main.webp", img_alt = "Óscar Fe
La descripció és contingut Markdown normal, escrit fora del front matter.
#### Mostrant publicacions recents
Si vols mostrar publicacions a la pàgina principal, primer necessites decidir si la seva ruta serà `/` o quelcom diferent, com ara `/blog/`.
Si vols servir les publicacions des de `/`, necessites configurar `paginate_by = 5` al front matter del teu arxiu `_index.md`. **Nota**: això no es configura a l'apartat `[extra]`, sinó al front matter principal. Exemple:
@@ -138,6 +142,21 @@ Fixa't que si configures `section_path`, no cal que configuris `paginate_by`. Po
El `title` és el títol que apareix a sobre de les publicacions.
#### Llistat de Projectes
Pots mostrar una selecció de projectes a la teva pàgina principal. Per fer això, primer necessitaràs configurar el directori `projects`.
Un cop fet això, configura la ruta als projectes a la secció `[extra]` del teu fitxer `_index.md`:
```toml
[extra]
projects_path = "projects/_index.md"
```
Això mostrarà els 3 projectes de major prioritat (amb menor pes; el mateix ordre que a Projectes). Per mostrar més o menys projectes, configura `max_projects` a `[extra]`.
Per defecte, la secció de projectes es mostrarà a la part inferior de la pàgina principal, sota les publicacions. Si prefereixes mostrar-la a la part superior, configura `show_projects_first = true`.
### Commutador de mode clar i fosc
| Pàgina | Secció | `config.toml` | Segueix la jerarquia | Requereix JavaScript |

View File

@@ -1,7 +1,7 @@
+++
title = "Domina la configuración de tabi: guía completa"
date = 2023-09-18
updated = 2024-03-15
updated = 2024-04-23
description = "Descubre las múltiples maneras en que puedes personalizar tabi."
[taxonomies]
@@ -99,6 +99,8 @@ La [página principal](/) de esta demo tiene un encabezado con una imagen, un t
{{ dual_theme_image(light_src="blog/mastering-tabi-settings/img/header_light.webp", dark_src="blog/mastering-tabi-settings/img/header_dark.webp", alt="Encabezado de la página principal") }}
#### Cabecera
Para configurar la imagen y el título, puedes usar la variable `header` en el front matter del archivo `_index.md` de la sección. Por ejemplo:
```toml
@@ -108,6 +110,8 @@ header = {title = "¡Hola! Soy tabi~", img = "blog/mastering-tabi-settings/img/m
La descripción es contenido Markdown normal, escrito fuera del front matter.
#### Mostrando publicaciones recientes
Si deseas mostrar publicaciones en la página principal, primero necesitas decidir si su ruta será `/` o algo como `/blog`.
Si quieres servir las publicaciones desde `/`, necesitas configurar `paginate_by = 5` en el front matter de tu archivo `_index.md`. **Nota**: esto no se configura en el apartado `[extra]`, sino en el front matter principal. Ejemplo:
@@ -138,6 +142,21 @@ Fíjate que si configuras `section_path`, no necesitas configurar `paginate_by`.
El `title` es el encabezado que aparece sobre las publicaciones.
#### Listado de proyectos
Puedes mostrar una selección de proyectos en tu página principal. Para hacer esto, primero necesitarás configurar el directorio `projects`.
Una vez hecho esto, configura la ruta a los proyectos en la sección `[extra]` de tu archivo `_index.md`:
```toml
[extra]
projects_path = "projects/_index.md"
```
Esto mostrará los 3 proyectos de mayor prioridad (con menor peso; el mismo orden que en Proyectos). Para mostrar más o menos proyectos, puedes establecer `max_projects` en `[extra]`.
Por defecto, la sección de proyectos se mostrará en la parte inferior de la página principal, bajo los posts. Si prefieres que aparezca en la parte superior, establece `show_projects_first = true`.
### Interruptor de modo claro y oscuro
| Página | Sección | `config.toml` | Sigue la jerarquía | Requiere JavaScript |

View File

@@ -1,7 +1,7 @@
+++
title = "Mastering tabi Settings: A Comprehensive Guide"
date = 2023-09-18
updated = 2024-03-15
updated = 2024-04-23
description = "Discover the many ways you can customise your tabi site."
[taxonomies]
@@ -99,6 +99,8 @@ The [main page](/) of this demo has a header with an image, a title and descript
{{ dual_theme_image(light_src="blog/mastering-tabi-settings/img/header_light.webp", dark_src="blog/mastering-tabi-settings/img/header_dark.webp", alt="Main page header") }}
#### Heading
To set the image and title, you can use the `header` variable in the front matter of the section's `_index.md` file. For example:
```toml
@@ -108,6 +110,8 @@ header = {title = "Hello! I'm tabi~", img = "img/main.webp", img_alt = "Óscar F
The description is regular Markdown content, set outside the front matter.
#### Listing Recent Posts
If you'd like to show posts on the main page, you first need to decide whether their path will be `/` or something like `/blog`.
If you want to serve the posts from `/`, you need to set `paginate_by = 5` in the front matter of your `_index.md` file. **Note**: this is not in the `[extra]` section, but in the main front matter. Example:
@@ -138,6 +142,21 @@ Notice how if you set `section_path`, you don't need to set `paginate_by`. You c
The `title` is the header that appears above the posts.
#### Listing Projects
You can showcase a selection of projects on your main page. To do this, you'll need to set up the `projects` directory first.
Once that's done, you configure the path to the projects in the `[extra]` section of your `_index.md` file:
```toml
[extra]
projects_path = "projects/_index.md"
```
By default, this will show the 3 projects with the highest priority (smallest weight; same sorting as Projects page). To show more or fewer projects, you can set `max_projects` in the `[extra]` section.
By default, the featured projects will be shown after the posts. If you want to show the projects before the posts, set `show_projects_first = true`.
### Light and Dark Mode Switcher
| Page | Section | `config.toml` | Follows Hierarchy | Requires JavaScript |