aboutsummaryrefslogtreecommitdiff
path: root/templates/posts.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/posts.html')
-rw-r--r--templates/posts.html21
1 files changed, 16 insertions, 5 deletions
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 %}
<div>
{%- if section_item.title %}
<h2>{{ section_item.title }}</h2>
{%- endif %}
-
- {{ section_item.content | safe }}
-
{%- for year, posts in section_item.pages | group_by(attribute="year") %}
- {%- if section_item.title %}<h3>{{ year }}</h3>{%- else %}<h2>{{ year }}</h2>{%- endif %}
+ {%- if not hide_section_dates %}
+ {%- if section_item.title %}
+ <h3>{{ year }}</h3>
+ {%- else %}
+ <h2>{{ year }}</h2>
+ {%- endif %}
+ {%- endif %}
{%- for post in posts %}
- <p><a href="{{ post.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ post.title }}</a> - <time datetime="{{ post.date }}">{{ post.date | date(format="%F") }}</time></p>
+ <p><a href="{{ post.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ post.title }}</a>{%- if not hide_section_dates %} - <time datetime="{{ post.date }}">{{ post.date | date(format="%F") }}</time>{%- endif %}</p>
{%- endfor %}
{%- endfor %}
</div>