Making Jekyll blog-aware
In this recipe, we will make Jekyll blog-aware. To do this, we need to set up our posts. The way that Jekyll works is, it allows us to add posts inside a partial folder titled _posts
. This folder was automatically created for us when we ran the jekyll new
command.
Next, we need to create our files, using either the markdown or the HTML file extension. While markdown can be described as a simplified HTML format, one wonderful thing about using it is that the code inside can be HTML, at least in Jekyll. Jekyll will compile markdown files that have HTML inside of them without issues. That is why we will be using markdown files for our posts.
Jekyll posts also need to follow another convention--a naming convention. This naming convention is what allows Jekyll to be blog-aware. Each post in Jekyll needs to have the YYYY-MM-DD-title-of-post.markdown
structure. Alternatively, you can use YYYY-MM-DD-title-of-post.html
, but as already explained, we will use the first option...