It takes me a while to format the correct structure Jekyll requires for new posts. I found this plugin Jetpack Compose which makes this process quite easy.

You get some new commands after installing it.

draft      # Creates a new draft post with the given NAME
post       # Creates a new post with the given NAME
publish    # Moves a draft into the _posts directory and sets the date
unpublish  # Moves a post back into the _drafts directory
page       # Creates a new page with the given NAME
rename     # Moves a draft to a given NAME and sets the title
compose    # Creates a new file with the given NAME

I’ve added following aliases in my shell.

alias np="bundle exec jekyll post"
alias js="bundle exec jekyll serve"

All I’ve do to now is just - np “Post title”. It auto creates the new file with correct format and the title.

Now, I wanted to auto open this in my default editor (VS code) and add a empty permalink front matter to customize the post url.

You can do that by adding following to your Jekyll config file:

jekyll_compose:
  auto_open: true
  default_front_matter:
    posts:
      permalink:

And these to your shell:

export JEKYLL_EDITOR=code

Few seconds saved and early dementia expedited :) .