Jekyll Filename Without Date

krisanalfa picture krisanalfa · Nov 24, 2014 · Viewed 8.3k times · Source

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.

How can I post a page in Jekyll without this filename pattern? Something like:

  • awesome-title.md
  • yet-another-title.md
  • etc.md

Thanks for your advance.

Answer

Seth Warburton picture Seth Warburton · Oct 6, 2016

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:

My config.yaml

My Pages collection