Skip to content

Commit debabaa

Browse files
committed
Fix:When pushing an article for the first time, the date is directly overwritten with the current time.
1 parent d2a87ce commit debabaa

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

_posts/2026-04-08-Mitigating-Hallucinations-in-Large-Vision-Language-Models-by-Adaptively-Constraining-Information-low.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
categories:
33
- paper
4-
date: 2026-03-25 18:50:51 +0800
4+
date: 2026-04-10 18:50:51 +0800
55
layout: post
66
tags:
77
- AAAI

scripts/blog_lifecycle_manager.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,22 @@ def process_lifecycle():
4848
except: continue
4949

5050
needs_update = False
51-
52-
# 1. 发布时间处理:仅针对占位符进行初始化
53-
if not fm_date or "UPLOAD_TIME" in fm_date or "2026-01-01" in fm_date:
51+
current_body = body.replace('\r\n', '\n').strip()
52+
committed_body = get_git_body(filepath, ref=compare_ref)
53+
is_new_post = committed_body is None
54+
55+
if is_new_post or not fm_date or "UPLOAD_TIME" in fm_date or "2026-01-01" in fm_date:
5456
front_matter["date"] = now_str
55-
# 极简原则:新发布时不添加更新时间字段
5657
if "last_modified_at" in front_matter:
5758
del front_matter["last_modified_at"]
5859
print(f"🆕 [发布初始化] {filename} (已锁定发布日期)", flush=True)
5960
needs_update = True
6061
else:
61-
# 2. 更新时间监测:精准变动监测
62-
current_body = body.replace('\r\n', '\n').strip()
63-
committed_body = get_git_body(filepath, ref=compare_ref)
64-
6562
if committed_body is not None and current_body != committed_body:
66-
# 仅在正文确实变动时才创建/更新 last_modified_at
6763
front_matter["last_modified_at"] = now_str
6864
print(f"📝 [正文内容更新] {filename} (检测到变动,已更新时间戳)", flush=True)
6965
needs_update = True
7066
elif fm_mod and (fm_mod == fm_date):
71-
# 极简原则:如果更新时间等于发布时间,则视为冗余,直接删除该字段
7267
del front_matter["last_modified_at"]
7368
print(f"🧹 [清理冗余数据] {filename} (已移除与发布日期相同的更新时间字段)", flush=True)
7469
needs_update = True

0 commit comments

Comments
 (0)