集合和草稿,或非输出元素

lif*_*foo 1 jekyll

我正在使用 Jekyll 集合来渲染一组页面:

collections:
    mycoll:
        output: true
        permalink: /:collection/:path/
Run Code Online (Sandbox Code Playgroud)

和一组文件:

_mycoll/
    el1.md
    el2.md
    el3.md
    ...
Run Code Online (Sandbox Code Playgroud)

但我需要避免生成该集合的某些页面,就像帖子草稿一样。

是否可以?

Dav*_*uel 5

在 jekyll 2.x 下,使用_config.yml排除数组:

exclude:
 - _mycoll/el2.md
Run Code Online (Sandbox Code Playgroud)

在 Jekyll 3.x 中,使用帖子/收藏项的published前事项变量

---
title: toto
published: false
---
content
Run Code Online (Sandbox Code Playgroud)