Officially, filters and tags are plugins so they go into the jekyll-root/_plugins directory. Once again, no _config.yml modifications necessary (in the version of Jekyll (3.7.3) that I was using) to enable things.
This is where I admit that I don’t really know how to program Ruby (or Liquid). That said, I have been a programmer for 40 years, although the last 10 have rarely needed more than HTML, so I’m rusty as hell, but programming languages are programming languages (hubris!?) and Google will tell me the extra details I need to know. To get started, in Ruby we don’t need to declare variables before we start using them, Ruby is very white space (indent) sensitive, and getting variable values in a string is done by "#{variable}"
Now, I’m going to try to duplicate what I’ve already gotten working as an include function. This will be Ruby so jekyll-root/_plugins/filename.rb
Changes to plugins requires a full restart of your Jekyll instance, unlike includes where you can just fiddle and reload the page in your browser to see your progress.
It turns out that filters (Ruby?) don’t like blank parameters. If it is possible that a parameter might be there, and it is not then Ruby will not compile/Jekyll will not restart. Even if you test for undefined variables before using them, Ruby balks. So, instead of one include, I ended up with fourfilters.
They are called like so:
I don’t remember if I needed the module Jekyll right from the beginning or if I added it later, but it doesn’t hurt anything so…
Trading elegance of implementation (includes) for (sort of!) elegance of use (filters).