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

推荐订阅源

爱范儿
爱范儿
博客园 - 【当耐特】
量子位
Engineering at Meta
Engineering at Meta
博客园_首页
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
V
Visual Studio Blog
小众软件
小众软件
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
Jina AI
Jina AI
The Cloudflare Blog
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
博客园 - 聂微东

Recent Commits to jekyll:master

docs: Update Getform branding to Forminit (#10006) · jekyll/jekyll@541d8b2 fix(core): avoid mutating document data for fallback dates (#9981) · jekyll/jekyll@78aac81 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 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
Allow configuring future metadata for individual collecti...
kcdragon · 2026-03-11 · via Recent Commits to jekyll:master
Original file line numberDiff line numberDiff line change

@@ -0,0 +1,42 @@

1+

# frozen_string_literal: true

2+
3+

require "helper"

4+
5+

class TestPublisher < JekyllUnitTest

6+

context "default configuration" do

7+

setup do

8+

site = fixture_site

9+

collection = Jekyll::Collection.new(site, "methods")

10+

@thing = Jekyll::Document.new(

11+

source_dir("methods/method.md"),

12+

:site => site,

13+

:collection => collection

14+

)

15+

@thing.data["date"] = (Time.now + (60 * 60 * 24)).to_i # tomorrow

16+

@publisher = Jekyll::Publisher.new(site)

17+

end

18+
19+

should "be hidden in the future" do

20+

assert @publisher.hidden_in_the_future?(@thing)

21+

end

22+

end

23+
24+

context "when a thing's collection is configured to show future posts" do

25+

setup do

26+

site = fixture_site

27+

collection = Jekyll::Collection.new(site, "methods")

28+

collection.metadata["future"] = true

29+

@thing = Jekyll::Document.new(

30+

source_dir("methods/method.md"),

31+

:site => site,

32+

:collection => collection

33+

)

34+

@thing.data["date"] = (Time.now + (60 * 60 * 24)).to_i # tomorrow

35+

@publisher = Jekyll::Publisher.new(site)

36+

end

37+
38+

should "not be hidden in the future" do

39+

refute @publisher.hidden_in_the_future?(@thing)

40+

end

41+

end

42+

end