惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
U
Unit 42
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
J
Java Code Geeks
D
DataBreaches.Net
B
Blog RSS Feed
D
Docker
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
Y
Y Combinator Blog
A
About on SuperTechFans
V
V2EX
罗磊的独立博客
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
月光博客
月光博客
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
阮一峰的网络日志
阮一峰的网络日志

Recent Commits to jekyll:master

docs: Update Getform branding to Forminit (#10006) · jekyll/jekyll@541d8b2 docs: Add harvis to third-party deployment docs (#10009) · jekyll/jekyll@20ea323 build: soft deprecate old rubies (#10016) · jekyll/jekyll@6504236 build: update allowed cc types from the spec summary (#10017) · jekyll/jekyll@578d65b docs: remove the stale duplicate Code of Conduct page (#10010) · jekyll/jekyll@d2650e8 fix: update clean command to take account of the keep_files option (#… · jekyll/jekyll@74d7513 docs: add DeployHQ to third-party deployment providers (#9991) · jekyll/jekyll@7697d24 docs: update wsl installation procedure (#9968) · jekyll/jekyll@202df57 fix: Run release-please workflow only in jekyll/jekyll repo (#9969) · jekyll/jekyll@d68f76e feat!: Streamline the release process for Jekyll (#9760) · jekyll/jekyll@5cf05d7 Update history to reflect merge of #9960 [ci skip] · jekyll/jekyll@08c22ee Add GitCMS to resources docs (#9960) · jekyll/jekyll@3ed83f6 Update history to reflect merge of #9954 [ci skip] · jekyll/jekyll@ff0d4dd build: fix broken CI on newer rubies (#9954) · jekyll/jekyll@65d534a Update history to reflect merge of #9925 [ci skip] · jekyll/jekyll@baab7bf Allow configuring future metadata for individual collections (#9925) · jekyll/jekyll@f07d4f7 Update history to reflect merge of #9914 [ci skip] · jekyll/jekyll@d0cf179 Add .ruby-lsp to default excludes (#9914) · jekyll/jekyll@3c45d9e Update history to reflect merge of #9920 [ci skip] · jekyll/jekyll@26ec089 Add logger to Gemfile for Ruby 4.0 (#9920) · jekyll/jekyll@7e79e46 Update history to reflect merge of #9923 [ci skip] · jekyll/jekyll@b49aa9b Bump supported versions (#9923) · jekyll/jekyll@ebe567c Update history to reflect merge of #9897 [ci skip] · jekyll/jekyll@4d3db3a Update WDM (0.1.1 → 0.2.0) in the Windows docs (#9897) · jekyll/jekyll@6da6739 Update history to reflect merge of #9912 [ci skip] · jekyll/jekyll@161f654 docs: Update contributor badge in README to include avatar height and… · jekyll/jekyll@e1b5fd6 Update history to reflect merge of #9889 [ci skip] · jekyll/jekyll@2fe6977
fix(core): avoid mutating document data for fallback date...
apples-kksk · 2026-09-18 · via Recent Commits to jekyll:master
Original file line numberDiff line numberDiff line change

@@ -143,12 +143,14 @@ gettalong

143143

ghp

144144

ghpages

145145

giraffeacademy

146+

gitcms

146147

githubcom

147148

gitlab

148149

gjtorikian

149150

globbed

150151

gotcha

151152

Goulven

153+

GPT

152154

gridism

153155

GSo

154156

gsubbing

Original file line numberDiff line numberDiff line change

@@ -84,7 +84,7 @@ def merge_data!(other, source: "YAML front matter")

8484

#

8585

# Return document date string.

8686

def date

87-

data["date"] ||= (draft? ? source_file_mtime : site.time)

87+

data["date"] || fallback_date

8888

end

8989
9090

# Return document file modification time in the form of a Time object.

@@ -539,5 +539,9 @@ def modify_date(date)

539539

def generate_excerpt

540540

data["excerpt"] ||= Jekyll::Excerpt.new(self) if generate_excerpt?

541541

end

542+
543+

def fallback_date

544+

@fallback_date ||= (draft? ? source_file_mtime : site.time)

545+

end

542546

end

543547

end

Original file line numberDiff line numberDiff line change

@@ -77,6 +77,14 @@ def setup_document_with_dates(filename)

7777

assert_equal Time.now.strftime("%Y/%m/%d"), @document.to_liquid["date"].strftime("%Y/%m/%d")

7878

end

7979
80+

should "not mutate its data when resolving a fallback date" do

81+

refute @document.data.key?("date")

82+
83+

@document.to_liquid["date"]

84+
85+

refute @document.data.key?("date")

86+

end

87+
8088

should "be jsonify-able" do

8189

page_json = @document.to_liquid.to_json

8290

parsed = JSON.parse(page_json)