Skip to content

Commit

Permalink
feat: allow always show post updated banner
Browse files Browse the repository at this point in the history
  • Loading branch information
yqs112358 committed Nov 14, 2024
1 parent 94049b2 commit d240377
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,10 @@ post:
# Update date is displayed at the beginning of the post. The default date is the update date of the md file, which can be manually specified by `updated` in front-matter (same format as date)
updated:
enable: false

# 是否永久显示更新时间横幅,如为false则仅修改文章后才显示
# Whether to permanently display the update-time banner. If set to false then it will only be displayed after modifying the article
always_show: false

# 格式参照 ISO-8601 日期格式化
# ISO-8601 date format
Expand Down
2 changes: 1 addition & 1 deletion layout/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ page.banner_mask_alpha = page.banner_mask_alpha || theme.post.banner_mask_alpha
<div id="board">
<article class="post-content mx-auto">
<h1 id="seo-header"><%= page.subtitle || page.title %></h1>
<% if (theme.post.updated.enable && theme.post.updated && compare_date(page.date, page.updated)) { %>
<% if (theme.post.updated.enable && theme.post.updated && (theme.post.updated.always_show || compare_date(page.date, page.updated))) { %>
<p id="updated-time" class="note note-<%= theme.post.updated.note_class || 'info' %>" style="<%= theme.post.updated.relative ? 'display: none' : '' %>">
<% if (theme.post.updated.relative) { %>
<% if (theme.post.updated.content) { %>
Expand Down

0 comments on commit d240377

Please sign in to comment.