forked from deepStateMirrors/tabi
✨ feat: allow setting post_listing_date per section
This commit is contained in:
parent
db5062fb3f
commit
a3ae897c83
4 changed files with 15 additions and 2 deletions
|
@ -68,7 +68,9 @@
|
|||
|
||||
{%- if "dates" in metadata -%}
|
||||
{%- set allowed_post_listing_dates = ["date", "updated", "both"] -%}
|
||||
{%- set post_listing_date = config.extra.post_listing_date | default(value="date") -%}
|
||||
{#- Calling the hierarchy macro here causes an error due to the "get parents" part of the macro. -#}
|
||||
{#- This seems cleaner. -#}
|
||||
{%- set post_listing_date = section.extra.post_listing_date | default(value=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 -%}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue