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"
This commit is contained in:
parent
61fdbcb83a
commit
8da583d403
2 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
||||||
{% assign all_list = '' | split: '' %}
|
{% assign all_list = '' | split: '' %}
|
||||||
|
|
||||||
{% for post in site.posts %}
|
{% for post in site.posts %}
|
||||||
{% if post.last_modified_at %}
|
{% if post.last_modified_at and post.last_modified_at != post.date %}
|
||||||
{% capture elem %}
|
{% capture elem %}
|
||||||
{{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
|
{{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
|
@ -21,7 +21,7 @@ tail_includes:
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!-- lastmod date -->
|
<!-- lastmod date -->
|
||||||
{% if page.last_modified_at %}
|
{% if page.last_modified_at and page.last_modified_at != page.date %}
|
||||||
<span>
|
<span>
|
||||||
{{ site.data.locales[lang].post.updated }}
|
{{ site.data.locales[lang].post.updated }}
|
||||||
{% include datetime.html date=page.last_modified_at tooltip=true lang=lang %}
|
{% include datetime.html date=page.last_modified_at tooltip=true lang=lang %}
|
||||||
|
|
Loading…
Reference in a new issue