To start, the JSON file is in the root of the Jekyll site, making it a simple file without Jekyll powers. I keep it there so it’s easier to find, especially for contributors. A few times I had considered moving it to
_data/ because with a Jekyll data file I can use liquid to
else the data all I want.
I also thought about duplicating the file so that I’d have the best of both worlds, but that’s hard to maintain. And then I thought about creating a symlink. I had never created one before, but thanks to the Internet I opened Terminal and entered:
And symlink! (Ok, it wasn’t that smooth. It took me a bit to figure out how to write the path. And then after I pushed, I got a build error because I originally didn’t use a relative path.)
But will it loop?
I created a file in the root
families.csv and wrote:
And soon I had a CSV file with a list of the font family names.
I also used “very ugly string manipulation hacks” to get a distinct list of tags and in alphabetical order. And with a few more very ugly string manipulation hacks, I got the CSV file looking exactly how I wanted:
Since Github pages run in safe mode the file won’t build in production. (It’s still totally a success though.)