Skip to content

Commit

Permalink
Optimize the behavior of post_meta when use_date_for_updated is e…
Browse files Browse the repository at this point in the history
…nabled
  • Loading branch information
stevenjoezhang committed Jun 4, 2020
1 parent 413e975 commit 241fe98
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions layout/_macro/post.njk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

{%- set date_diff = date(post.date) != date(post.updated) %}
{%- set time_diff = time(post.date) != time(post.updated) %}
{%- set datetime_diff = date_diff or time_diff %}

{%- if theme.post_meta.created_at %}
<span class="post-meta-item">
Expand All @@ -63,10 +62,8 @@
</span>
{%- endif %}

{%- if theme.post_meta.updated_at.enable and datetime_diff %}
{%- set display_updated = not theme.post_meta.updated_at.another_day or theme.post_meta.updated_at.another_day and date_diff %}

{%- if display_updated or not theme.post_meta.created_at %}
{%- if theme.post_meta.updated_at.enable %}
{%- if not theme.post_meta.updated_at.another_day or date_diff or not theme.post_meta.created_at %}
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
Expand Down

1 comment on commit 241fe98

@stevenjoezhang
Copy link
Member Author

@stevenjoezhang stevenjoezhang commented on 241fe98 Jun 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.