From 062152cd76fa8deb93078a7f9e7c5ec44a2c688f Mon Sep 17 00:00:00 2001 From: Christian Reitter Date: Sat, 2 Dec 2023 16:50:25 +0100 Subject: [PATCH] Improve post template handling of dates and authors --- _layouts/post.html | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/_layouts/post.html b/_layouts/post.html index 1eb6331..51c52d3 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -7,18 +7,20 @@ layout: default

{{ page.title | escape }}

{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%} - - {%- if page.modified_date -%} - ~ - {%- assign mdate = page.modified_date | date_to_xmlschema -%} - +
+ {%- if page.last_modified_at -%} + {%- assign mdate = page.last_modified_at | date_to_xmlschema -%} + {%- endif -%} +
{%- if page.author -%} - Author(s): {% for author in page.author -%} + {% for author in page.author -%}{%- assign author_count = author_count | plus: 1 -%}{% endfor %} + {%- if author_count==1 -%} + Author + {%- else -%} + Authors + {%- endif -%} + : {% for author in page.author -%} {%- if forloop.last == false %}, {% endif -%} {% endfor %}