没有日期的Jekyll文件名 [英] Jekyll Filename Without Date
问题描述
我想使用Jekyll和GitHub Pages建立文档站点.问题在于Jekyll仅接受_posts
下的文件名,且文件名与YYYY-MM-DD-your-title-is-here.md
完全一样.
I want to build documentation site using Jekyll and GitHub Pages. The problem is Jekyll only accept a filename under _posts
with exact pattern like YYYY-MM-DD-your-title-is-here.md
.
如何在没有此文件名模式的情况下在Jekyll中发布页面?像这样:
How can I post a page in Jekyll without this filename pattern? Something like:
-
awesome-title.md
-
yet-another-title.md
-
etc.md
awesome-title.md
yet-another-title.md
etc.md
感谢您的进步.
推荐答案
不使用帖子;帖子是带有日期的东西.听起来您可能想改用集合;您获得了Posts的全部权力;但没有讨厌的日期/命名要求.
Don't use posts; posts are things with dates. Sounds like you probably want to use collections instead; you get all the power of Posts; but without the pesky date / naming requirements.
https://jekyllrb.com/docs/collections/
我几乎将所有不是帖子的东西都使用收藏集.这是我自己的网站配置为对页面"以及我网站的更具体部分使用集合的方式:
I use collections for almost everything that isn't a post. This is how my own site is configured to use collections for 'pages' as well as more specific sections of my site:
这篇关于没有日期的Jekyll文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!