Skip to content

Commit

Permalink
feat: support hiding the modification date of a post (#1020)
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
darianmiller authored and cotes2020 committed May 6, 2023
1 parent 61fdbcb commit 8da583d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _includes/update-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1 data-toc-skip>{{ page.title }}</h1>
</span>

<!-- lastmod date -->
{% if page.last_modified_at %}
{% if page.last_modified_at and page.last_modified_at != page.date %}
<span>
{{ site.data.locales[lang].post.updated }}
{% include datetime.html date=page.last_modified_at tooltip=true lang=lang %}
Expand Down

0 comments on commit 8da583d

Please sign in to comment.