Learn more about Russian war crimes in Ukraine.

How I start Jekyll blog posts

I start every blog post by running a command which creates a new blog post file, like this:

$ blogpost 'How I start Jekyll blog posts'
$ cat _posts/2018-12-30-how-i-start-jekyll-blog-posts.md
---
title: "How I start Jekyll blog posts"
tags: []
---

I find this very useful to jot down blog post ideas! Instead of keeping blog post ideas in some separate checklist, I keep the ideas directly in the posts directory. If they turn out fruitful, I’ll commit the file and publish it. Otherwise, the file sits around for a few months, and maybe gets deleted eventually. I can see all of my blog post ideas with git status.

The blogpost command takes the post title 'How I start Jekyll blog posts' and the current date 2018-12-30, and creates the file _posts/2018-12-30-how-i-start-jekyll-blog-posts.md. Jekyll will take this file name and host it at the URL https://jameshfisher.com/2018/12/30/how-i-start-jekyll-blog-posts. The blogpost command also lays out the Jekyll ‘front matter’. blogpost is an command in my .bashrc which looks like:

function blogpost {
  printf -- "---\ntitle: \"$1\"\ntags: []\n---\n\n" > "/Users/jim/dev/jameshfisher/jameshfisher.com/_posts/$(date '+%Y-%m-%d')-$(echo $1 | tr '[:upper:] ' '[:lower:]-' | tr -cd "[:alnum:]-").md"
}

What can computers do? What are the limits of mathematics? And just how busy can a busy beaver be? This year, I’m writing Busy Beavers, a unique interactive book on computability theory. You and I will take a practical and modern approach to answering these questions — or at least learning why some questions are unanswerable!

It’s only $19, and you can get 50% off if you find the discount code ... Not quite. Hackers use the console!

After months of secret toil, I and Andrew Carr released Everyday Data Science, a unique interactive online course! You’ll make the perfect glass of lemonade using Thompson sampling. You’ll lose weight with differential equations. And you might just qualify for the Olympics with a bit of statistics!

It’s $29, but you can get 50% off if you find the discount code ... Not quite. Hackers use the console!

More by Jim

Tagged #programming, #blog, #jekyll. All content copyright James Fisher 2018. This post is not associated with my employer. Found an error? Edit this page.