mirror of
https://github.com/welpo/tabi.git
synced 2025-12-14 11:48:45 +01:00
validate settings + use 'date' by default + mention default in comments
This commit is contained in:
parent
f3946dc7c6
commit
77a4b5ff80
3 changed files with 11 additions and 5 deletions
|
|
@ -147,10 +147,10 @@ show_reading_time = true
|
|||
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.
|
||||
# "date" - Show only the original date of the post (default if unset).
|
||||
# "updated" - Show only the last updated date of the post.
|
||||
# "both" - Show both the original date and the last updated date.
|
||||
post_listing_date = "both"
|
||||
post_listing_date = "date"
|
||||
|
||||
# DEPRECATED!
|
||||
# Use Zola's built-in `bottom_footnotes = true` in the [markdown] section instead. (Available since v0.19.0)
|
||||
|
|
|
|||
|
|
@ -14,8 +14,14 @@
|
|||
{% endif %}
|
||||
|
||||
<ul class="bloglist-meta">
|
||||
{%- set show_date = post.date and config.extra.post_listing_date == "date" or post.date and config.extra.post_listing_date == "both" -%}
|
||||
{%- set show_updated = post.updated and config.extra.post_listing_date == "updated" or post.updated and config.extra.post_listing_date == "both" -%}
|
||||
{%- set allowed_post_listing_dates = ["date", "updated", "both"] -%}
|
||||
{%- set post_listing_date = config.extra.post_listing_date | default(value="date") -%}
|
||||
{%- if post_listing_date not in allowed_post_listing_dates -%}
|
||||
{{ 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_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 -%}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ show_reading_time = true
|
|||
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.
|
||||
# "date" - Show only the original date of the post (default if unset).
|
||||
# "updated" - Show only the last updated date of the post.
|
||||
# "both" - Show both the original date and the last updated date.
|
||||
post_listing_date = "date"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue