Getting headers right in Jekyll
• Mark Eschbach
So Jekyll has served me well for about a year and half now. It’s a nice simple blogging system which does not get in
the way too much. It does, however drive me crazy I need to start every new section off with a three ###
and
the articles have no divides between the sections.
Time to see if I can make some improvements there. First task: update Jekyll. Turns out I was using a rather old
version of Ruby to! 2.3.0
! Using rbenv
on my laptop makes the upgrade simple. I will have to cross the river of
using that on for the Jenkins system I setup when I push.
A simple bundle outdated >outdated
will produce a list of outdated specs. Jekyll is of course out of date, taking me
from 3.7.0
to 3.8.1
. The changelog makes this upgrade look easy enough. This
is really hte only pinned dependency there. So let us see what happens with a quick bundle update
. Bam! Done,
including all the transitive dependencies.
Alrighty! Onto the the next task: configuring the header default level to 2 for each post title and 3+ for all additional headers. The kramdown toc_levels looks somewhat promising, although I’m not sure if it is exactly what I am searching for. Let us give it a whirl!
Example header
Nope, that failed. Next up is header_offset
. Bingo! For this site I use h2
to denote titles and h3
+ to denote
section starts. Tune in next time to watch me figure out how to break each header into its own section
tag!