Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

允许”本文最后更新于“横幅永久显示 #1153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading