Skip to content

Commit 8da583d

Browse files
darianmillercotes2020
authored andcommittedMay 6, 2023
feat: support hiding the modification date of a post (cotes2020#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"
1 parent 61fdbcb commit 8da583d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎_includes/update-list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% assign all_list = '' | split: '' %}
88

99
{% for post in site.posts %}
10-
{% if post.last_modified_at %}
10+
{% if post.last_modified_at and post.last_modified_at != post.date %}
1111
{% capture elem %}
1212
{{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
1313
{% endcapture %}

‎_layouts/post.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h1 data-toc-skip>{{ page.title }}</h1>
2121
</span>
2222

2323
<!-- lastmod date -->
24-
{% if page.last_modified_at %}
24+
{% if page.last_modified_at and page.last_modified_at != page.date %}
2525
<span>
2626
{{ site.data.locales[lang].post.updated }}
2727
{% include datetime.html date=page.last_modified_at tooltip=true lang=lang %}

0 commit comments

Comments
 (0)