如何在代码中创建高度收藏
我想根据“标签”前材料以外的逻辑创建集合:
- 我们使用FrontMatter用
status
来标记我们的文章。我想用它为所有不同状态提供收集。然后,我可以轻松地显示所有“评论中”的帖子。 - 我们有年度审核政策,因此我希望每晚建造在此审核日期的一个月内拾取所有文章,并将其添加到另一个收藏中。
那么,是否有一种方法可以在110中编程创建一个集合?
谢谢
I'd like to create collections based on logic other than 'tags' frontmatter:
- We use frontmatter to mark our articles with a
status
. I'd like to use this to provide collections for all the different statuses. Then I can easily show all posts 'in review' for example. - We have a yearly review policy, so I'd like a nightly build to pick up all articles within a month of this review date and add them to another collection.
So, is there a way to programmatically create a collection in 11ty?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有时我必须是盲目的...
我在文档中找到了答案:
Sometimes I must be word blind...
I've found the answer in the docs:
在此文章他们提供了一个很好的例子唯一类别的收集,类似您可以在代码中申请状态。请检查是否有帮助。
In this article they have provided a great example of creating collection of unique categories, similar you can apply for status in your code. Please check if that helps.