jekyllgithub-pages

Jekyll Filename Without Date


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:

Thanks for your advance.


Solution

  • 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