From 8da583d403456f6460ec1a6ebcbb0c2ca8127ff6 Mon Sep 17 00:00:00 2001 From: Darian Miller Date: Fri, 5 May 2023 21:35:01 -0500 Subject: [PATCH] feat: support hiding the modification date of a post (#1020) There is the current ability to set `last_modified_at` in the front matter of post and use that datetime instead of the built in logic. New feature in post.html: if the modified date time matches the date of the post, then don't show "Updated xxxx" --- _includes/update-list.html | 2 +- _layouts/post.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/update-list.html b/_includes/update-list.html index 0ee7b70..0b55225 100644 --- a/_includes/update-list.html +++ b/_includes/update-list.html @@ -7,7 +7,7 @@ {% assign all_list = '' | split: '' %} {% for post in site.posts %} - {% if post.last_modified_at %} + {% if post.last_modified_at and post.last_modified_at != post.date %} {% capture elem %} {{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}} {% endcapture %} diff --git a/_layouts/post.html b/_layouts/post.html index 2296df2..54e0262 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -21,7 +21,7 @@ tail_includes: - {% if page.last_modified_at %} + {% if page.last_modified_at and page.last_modified_at != page.date %} {{ site.data.locales[lang].post.updated }} {% include datetime.html date=page.last_modified_at tooltip=true lang=lang %}