Create a Post with Jekyll

How to create a post through the terminal while using Jekyll.

To simplify the creation of post while using jekyll it is possible to use the jekyll compose plugin which will allow us to create a post from the terminal.

Install plugin

Add the following line to the Gemfile of the website and then save the changes.

gem 'jekyll-compose', group: [:jekyll_plugins]

After this run the following command in the terminal.

$ bundle

Using the Plugin

To create a new page, run the following command replacing “Name of New Post”.

$ bundle exec jekyll post "Name of New Post"

After this command is run you will have a new post in the post folder with the title given previously.

The file name contains the date of the post and name which is used to create the url that the post will show up at.

You can now add content to this post 😊.

Share: Twitter Facebook LinkedIn