From 70821bbed6d2244168636fe1c79439459a1c7c78 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 13 Jul 2024 23:18:13 +0200 Subject: [PATCH 1/3] Fix if there is no updated date. --- templates/macros/list_posts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/macros/list_posts.html b/templates/macros/list_posts.html index d3760de4a..c410f2453 100644 --- a/templates/macros/list_posts.html +++ b/templates/macros/list_posts.html @@ -20,7 +20,7 @@ {{ throw(message="ERROR: Invalid value for config.extra.post_listing_date. Allowed values are 'date', 'updated', or 'both'.") }} {%- endif -%} - {%- set show_date = post.date and post_listing_date == "date" or post.date and post_listing_date == "both" -%} + {%- set show_date = post.date and post_listing_date == "date" or post.date and post_listing_date == "both" or post.date and post_listing_date == "updated" and not post.updated -%} {%- set show_updated = post.updated and post_listing_date == "updated" or post.updated and post_listing_date == "both" -%} {%- if show_date or show_updated -%} From 103b8ba263405125d752572d28a0636f75d1d9f9 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 14 Jul 2024 16:00:04 +0200 Subject: [PATCH 2/3] Add documentation. If there is no last updated date, it shows the original date. --- config.toml | 2 +- content/blog/mastering-tabi-settings/index.md | 6 +++++- theme.toml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config.toml b/config.toml index 29d607b1f..d21592414 100644 --- a/config.toml +++ b/config.toml @@ -148,7 +148,7 @@ show_date = true # Determines how dates are displayed in the post listing (e.g. front page or /blog). Options: # "date" - Show only the original date of the post (default if unset). -# "updated" - Show only the last updated date of the post. +# "updated" - Show only the last updated date of the post. If there is no last updated date, it shows the original date. # "both" - Show both the original date and the last updated date. post_listing_date = "date" diff --git a/content/blog/mastering-tabi-settings/index.md b/content/blog/mastering-tabi-settings/index.md index 32c5dbd32..05bfe2fea 100644 --- a/content/blog/mastering-tabi-settings/index.md +++ b/content/blog/mastering-tabi-settings/index.md @@ -146,9 +146,13 @@ The `title` is the header that appears above the posts. By default, when listing posts, the date of post creation is shown. You can configure which date(s) to display using the `post_listing_date` option. Available settings: - `date`: Show only the original date of the post (default). -- `updated`: Show only the last updated date of the post. +- `updated`: Show only the last updated date of the post. If there is no last updated date, it shows the original date. - `both`: Show both the original date and the last updated date. +```toml +post_listing_date = "date" +``` + #### 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. diff --git a/theme.toml b/theme.toml index 957bd9a3d..e9ff512ed 100644 --- a/theme.toml +++ b/theme.toml @@ -105,7 +105,7 @@ show_date = true # Determines how dates are displayed in the post listing (e.g. front page or /blog). Options: # "date" - Show only the original date of the post (default if unset). -# "updated" - Show only the last updated date of the post. +# "updated" - Show only the last updated date of the post. If there is no last updated date, it shows the original date. # "both" - Show both the original date and the last updated date. post_listing_date = "date" From 1a49b7fdc5c4a5a538d36fb1f932ccb9ef2f842c Mon Sep 17 00:00:00 2001 From: welpo Date: Sun, 14 Jul 2024 16:32:58 +0200 Subject: [PATCH 3/3] translate docs --- content/blog/mastering-tabi-settings/index.ca.md | 2 +- content/blog/mastering-tabi-settings/index.es.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/blog/mastering-tabi-settings/index.ca.md b/content/blog/mastering-tabi-settings/index.ca.md index 497947442..85af7bd3f 100644 --- a/content/blog/mastering-tabi-settings/index.ca.md +++ b/content/blog/mastering-tabi-settings/index.ca.md @@ -146,7 +146,7 @@ El `title` és el títol que apareix a sobre de les publicacions. Per defecte, quan es llisten els articles, es mostra la data de creació. Pots configurar quina(es) data(es) mostrar utilitzant l'opció `post_listing_date`. Configuracions disponibles: - `date`: Mostra només la data de publicació original de l'article (opció per defecte). -- `updated`: Mostra només la data de l'última actualització de l'article. +- `updated`: Mostra només la data de l'última actualització de l'article. Si no hi ha data d'actualització, es mostra la data de publicació original. - `both`: Mostra tant la data de publicació original com la data de l'última actualització. #### Llistat de Projectes diff --git a/content/blog/mastering-tabi-settings/index.es.md b/content/blog/mastering-tabi-settings/index.es.md index 6f78c8d10..2b45d4d92 100644 --- a/content/blog/mastering-tabi-settings/index.es.md +++ b/content/blog/mastering-tabi-settings/index.es.md @@ -146,7 +146,7 @@ El `title` es el encabezado que aparece sobre las publicaciones. Por defecto, cuando se listan los artículos, se muestra la fecha de creación. Puedes configurar qué fecha(s) mostrar usando la opción `post_listing_date`. Configuraciones disponibles: - `date`: Muestra solo la fecha de publicación original del artículo (opción por defecto). -- `updated`: Muestra solo la fecha de la última actualización del artículo. +- `updated`: Muestra solo la fecha de la última actualización del artículo. Si no hay fecha de actualización, muestra la fecha de publicación original. - `both`: Muestra tanto la fecha de publicación original como la fecha de la última actualización. #### Listado de proyectos