I was trying to do a simple math thing with Ruby when it occured to
me that maybe it wasn't working because I wasn't using an up to date
Ruby. Since I was intending
to upgrade
Jekyll from 3.x to 4.x, I thought "let's just do it
all!!!"
There is annoying little documentation about writing
a generator
for Jekyll, particularly since when searching for examples,
there is so much noise in form of hits for "static site generator."
Two decent examples are from
Ricardo
Lopes and
Starr
Horne of Honeybadger.
Starting at the beginning, you want to be putting my_generator.rb
in _plugins/ in the root directory of your
Jekyll site
directory.
For an absolute
"Hello, World" we can do:
which prints out to the terminal when you
bundle exec jekyll serve. Look for it
after Generating...
My site has many snippets of different languages, and I wanted to tag them for CSS purposes among other possible useful things marking them might make possible. One problem with that is I am still searching out the "correct" labelling, so using mutable tags would be easier to remember as well as change later....Read more
Getting Jekyll running was a little bit of a kerfuffle since I needed to update Ruby, but then Jekyll couldn't find the right version. Eventually this was resolved and I got Jekyll's out of the box test site up and running. The fact that Jekyll has a test server that runs on your development machine is very convenient, even if it doesn't run server side includes and the like.Read more