*Custom* *Jekyll* *Blog* *Post* *Titles*

I tell you how to customize your Jekyll blog post titles and include special characters like colon or quotes or > or *.

For background, the Jekyll engine by default takes the name of the file you save for your post and uses that name as your post’s title.

EXAMPLE:

If you save your post with the file name:

_posts/2016-12-14-custom-jekyll-blog-post-titles.md

Then Jekyll will render the blog post title as Custom Jekyll Blog Post Titles.

Behind the scenes Jekyll does the following:

  • removes the date and .md file extension
  • replaces the hyphens with spaces
  • and capitalizes the first letter of each word sandwiched between hyphens.

Now let’s say you want your title to be *Custom* *Jekyll* *Blog* *Post* *Titles*.

Maybe you’ll try saving your file as _posts/2016-12-14-*Custom*-*Jekyll*-*Blog*-*Post*-*Titles*.md.

But if you do, Jekyll will output your blog title as *custom* *jekyll* *blog* *post* *titles*.

Which is not what you want because you’ve lost title case.

So how do you get around Jekyll’s default behavior? How do you customize your Jekyll blog post titles?

You can do so by adding a title: variable in your YAML front matter and then wrapping quotes around the text you want for your title. The quotes are important because they allow you to include special characters. If you don’t use them and you include special characters, your page won’t render.

EXAMPLE:

YAML Front Matter

layout: post
title: "*Custom* *Jekyll* *Blog* *Post* *Titles*"
date: 2016-12-14

And then your blog title will output as desired: *Custom* *Jekyll* *Blog* *Post* *Titles*.

And that’s how you customize your Jekyll posts.

  • Save the post file as you wish and with correct formatting
  • Add a title: variable to your YAML front matter
  • And remember to throw in quotes around your title text if you’re including special characters
Twitter share ⤴