2
votes

https://jekyllrb.com/docs/variables/ 'Any files with front matter are subject to processing.'

https://jekyllrb.com/docs/posts/ 'All blog post files must begin with front matter which is typically used to set a layout or other meta data. '

I seem to have a file with no yaml format front matter - a file with some jekyll tags - https://joekingthethird3.github.io/2019/08/09/test but it still has been 'processed' - variables substituted etc. I am using github. You may laugh at my mistakes.

2

2 Answers

2
votes

GitHub Pages using jekyll-optional-front-matter as a dependency 5. It’s loaded automatically, so that explains why having .md files without front matter work on your GitHub Pages hosted site.

https://github.com/benbalter/jekyll-optional-front-matter explains why:

Out of the box, Jekyll requires that any markdown file have YAML front matter (key/value pairs separated by two sets of three dashes) in order to be processed and converted to HTML.

While that behavior may be helpful for large, complex sites, sometimes it's easier to simply add a plain markdown file and have it render without fanfare.

This plugin does just that. Any Markdown file in your site's source will be treated as a Page and rendered as HTML, even if it doesn't have YAML front matter.

2
votes

Posts in Jekyll are special entities. Their behavior is mostly inconsistent with the rest of Jekyll objects.

To that end, posts will get "processed" by Jekyll even if they do not have front matter. They just need to be a file named following the pattern YYYY-MM-DD-TITLE.extension somewhere inside a directory named _posts or _drafts.

(This behavior is independent of the jekyll-optional-front-matter plugin and can be reproduced with just vanilla Jekyll as well.)