recipes.priddle.xyz
In October 2020 I set about getting my assortment of recipes online in Markdown format. tl;dr checkout recipes.priddle.xyz, this sauce, and that sauce.
Anyway, I had been printing recipes on 6x4 inch index cards and keeping them in a nice wooden box on my kitchen counter. I had a really complicated Pages.app template for printing them on Avery card stock that had 2 cards per page. Each Pages document had 2 recipes in it. As I’d collect more recipes, I’d dutifully add or update a new document.
This worked to fill that little wooden box, but it sucked whenever I’d need to reprint a card (either to share with someone or because I dripped food/water on it). We also often had to send pictures or copy the text from a card into our phones to share recipes with people.
While I really liked the cards, I knew this thing needed a website, and recipes.priddle.xyz was born.
First, I came up with a simple format to contain all of my recipes in Markdown:
# Title
## Ingredients
Symbols
¼ ½ ¾ ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ →
°
## Directions
How to cook it goes here.
I keep a copy of this right in recipes/TEMPLATE.md
to copy from whenever I
add a new recipe. It is handy to have the symbols right there for
measurements and degrees.
A custom Jekyll build script iterates through all of the recipe Markdown files
in recipes/*
and generates 2 new files (the HTML file itself that one would
view on the web is generated by Jekyll itself).
.txt: I just copy the raw markdown file to a text file. I honestly
wanted to use .md
so I could link to /recipes/blah.md
, but GitHub Pages
didn’t like that.
.pdf: I use Prawn to generate a pdf card for each recipe. One
column is the ## Ingredients
section from the recipe, the other is the ##
Directions
section. I can also toss a ---
in the Directions section if a
recipe runs long, and the PDF will have a 2nd page added.
The best part of this is that I can quickly pull up any recipe on my phone if I need to — and we ended up sending a few people recipes over the holidays. I’ve actually been using the recipe cards a bit less now that I can just pull up things on my phone quickly. I do still like the cards for complicated recipes.
Another unexpected surprise this is that I was able to get the PDFs to print
from my printer right on single 6x4 cards without too much trouble. Now, I
just throw a recipe in a new .md
file, push to GitHub, and download a PDF.
I had a lot of fun hacking on this one!
Tags: Bash, Git, GitHub Pages, Jekyll, Ruby