🐛 fix(post_listing_date): show original date for unedited articles (#355)

main
sam 7 months ago committed by GitHub
parent a76d6888b6
commit 5db006ac47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -148,7 +148,7 @@ show_date = true
# Determines how dates are displayed in the post listing (e.g. front page or /blog). Options: # 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). # "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. # "both" - Show both the original date and the last updated date.
post_listing_date = "date" post_listing_date = "date"

@ -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: 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). - `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ó. - `both`: Mostra tant la data de publicació original com la data de l'última actualització.
#### Llistat de Projectes #### Llistat de Projectes

@ -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: 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). - `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. - `both`: Muestra tanto la fecha de publicación original como la fecha de la última actualización.
#### Listado de proyectos #### Listado de proyectos

@ -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: 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). - `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. - `both`: Show both the original date and the last updated date.
```toml
post_listing_date = "date"
```
#### Listing Projects #### 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. You can showcase a selection of projects on your main page. To do this, you'll need to set up the `projects` directory first.

@ -20,7 +20,7 @@
{{ throw(message="ERROR: Invalid value for config.extra.post_listing_date. Allowed values are 'date', 'updated', or 'both'.") }} {{ throw(message="ERROR: Invalid value for config.extra.post_listing_date. Allowed values are 'date', 'updated', or 'both'.") }}
{%- endif -%} {%- 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" -%} {%- set show_updated = post.updated and post_listing_date == "updated" or post.updated and post_listing_date == "both" -%}
{%- if show_date or show_updated -%} {%- if show_date or show_updated -%}

@ -105,7 +105,7 @@ show_date = true
# Determines how dates are displayed in the post listing (e.g. front page or /blog). Options: # 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). # "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. # "both" - Show both the original date and the last updated date.
post_listing_date = "date" post_listing_date = "date"

Loading…
Cancel
Save