如何创建“草稿”? Nanoc 中的项目?
我想根据元数据中的状态代码将帖子呈现到不同的文件夹。
例如,如果我有一个 status: Draft
属性,我希望将这些项目呈现到名为 /draft/
的文件夹,而 status: live
将渲染到 /blog/
。然后我可以用密码保护草稿文件夹,以便只有我可以查看它。如果根本没有状态,则默认为草稿。
这可能吗?
I'd like to render posts to different folders depending on a status code in the metadata.
For example, if I have an attribute of status: draft
I'd like for these items to be rendered to a folder called /draft/
, while status: live
would be rendered to /blog/
. I could then password protect the draft
folder so that only I could view it. If there is no status at all it would default to draft.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的规则文件中,使用以下内容:
这将为您拥有的每个状态创建一个目录。
以 开头的源文件
例如:将在 /testing/ 文件夹中创建
。要在编译后删除剩余文件,可以使用“nanoc prune”(nanoc 3.3.x 中的新增功能)。
In your rules file, use the following:
This will create a directory for each status you have.
Eg: A source file that begins with
will be created in the /testing/ folder.
To remove leftover files after compilation, you can use “nanoc prune” (new in nanoc 3.3.x).