Jekyll: Writing a Jekyll::Generator
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...
Let's just print out some file types this shows you the titles of pages, but not posts, with front matter on your site. Also, we show the path/file name, the path is relative to site root.
Using Site Variables, we have a selection of file types we can have a look at: Posts (presumably without collections. I don't have any, so...) static files are anything without front matter like images, javascript, css, text, so no titles posts + collections
html_pages
and html_files
don't seem to
work in this context...?