mirror of
https://github.com/pawroman/zola-theme-terminimal.git
synced 2025-02-23 05:34:34 +01:00
Allow customizing post date format
Now you can set the format of the date used in the post in the config: ```toml [extra] post_date_format = "%Y-%m-%d" ```
This commit is contained in:
parent
7f630a4e31
commit
9989929679
|
@ -34,6 +34,9 @@ accent_color = "blue"
|
||||||
# Defaults to accent color (or, if not accent color specified, to blue).
|
# Defaults to accent color (or, if not accent color specified, to blue).
|
||||||
background_color = "blue"
|
background_color = "blue"
|
||||||
|
|
||||||
|
# Format of the post date - defaults to "2025-01-13".
|
||||||
|
post_date_format = "%Y-%m-%d"
|
||||||
|
|
||||||
# The logo text - defaults to "Terminimal theme"
|
# The logo text - defaults to "Terminimal theme"
|
||||||
logo_text = "Terminimal theme"
|
logo_text = "Terminimal theme"
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
{% macro date(page) %}
|
{% macro date(page) %}
|
||||||
<span class="post-date">
|
<span class="post-date">
|
||||||
{%- if page.date %}
|
{%- if page.date %}
|
||||||
{{ page.date | date(format="%Y-%m-%d") }}
|
{{ page.date | date(format=config.extra.post_date_format) }}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
</span>
|
</span>
|
||||||
{% endmacro post_date %}
|
{% endmacro post_date %}
|
||||||
|
|
|
@ -30,6 +30,9 @@ accent_color = "blue"
|
||||||
# Defaults to accent color (or, if not accent color specified, to blue).
|
# Defaults to accent color (or, if not accent color specified, to blue).
|
||||||
background_color = "blue"
|
background_color = "blue"
|
||||||
|
|
||||||
|
# Format of the post date - defaults to "2025-01-13".
|
||||||
|
post_date_format = "%Y-%m-%d"
|
||||||
|
|
||||||
# The logo text - defaults to 2 non-breaking spaces.
|
# The logo text - defaults to 2 non-breaking spaces.
|
||||||
logo_text = "Terminimal theme"
|
logo_text = "Terminimal theme"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue