From 14f8b9cbcde3bd661b768f7f93b6bec808386c99 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Mon, 22 May 2023 23:29:33 -0700 Subject: posts template hide date option --- templates/posts.html | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'templates/posts.html') diff --git a/templates/posts.html b/templates/posts.html index 55d997f..e4562ab 100644 --- a/templates/posts.html +++ b/templates/posts.html @@ -39,17 +39,28 @@ This Template can also be used as the rendering template for Sections, eg: examp {%- else %} {%- set section_item = get_section(path=sec ~ "_index." ~ lang ~ ".md") %} {%- endif %} + {%- if sec != "" %} + {#- the section always overrides the config -#} + {%- if section_item.extra and 'hide_section_dates' in section_item.extra -%} + {%- set hide_section_dates = section_item.extra.hide_section_dates -%} + {%- elif config.extra.hide_section_dates -%} + {%- set hide_section_dates = true -%} + {%- endif -%} + {%- endif %}
{{ post.title }}{%- if not hide_section_dates %} - {%- endif %}
{%- endfor %} {%- endfor %}