Including Files in Jekyll

2 minute read

Updated:

Jekyll wants to be a blogging-first platform. For reasons I don’t know why. Blogging as a primary feature is fine and all but I don’t see why the architecture and design needs to be constrained to force everything to work in blogging context.

They seem unwilling to implement features that make it useful for general purpose website development.

I want to write recipes and iterate on them with learnings. These recipes would belong in a collection as non-blog pages.

I want to write a blog post that includes the snippet. And every time I try the recipe again, I will write another post and include the same recipe. The blog post will take about the experience, which I want to capture at that moment in time. If I have a bad recipe from the start, I don’t want to have it persist.

How-to

Here’s how you include a file from a collection:

{% assign recipe = site.recipes | where: "title",  "Ramen Noodles" | first %}
{{recipe.content}}

This will find a page in the recipes collection with the matching title. Then we include the page’s content.

Example

I used both SeriousEats and Alex as resources for technique and recipe.

Recipe

  • 45% water
  • 1.5% salt
  • 1% sodium carbonate

Sodium carbonate is baked baking soda. It’s trivial to make, simply place baking soda into a hot oven for hours. Over time, the baking soda will undergo thermal decomposition. You’ll know it’s done when it’s lost roughly 1/3 of original weight (as water vapor).

This hydration is higher than both references, which use 40%. I find this dough to too difficult to work with. This will be highly variable based on the type of flour used and how long you’ve had it; some flours absorb more than others. As always, adjust accordingly.

Technique

  1. Mix sodium carbonate and salt into water.
  2. Mix water into flour and combine.
  3. Once all the flour is incorporated, let the dough rest for 30 min. It will look like a rough, shaggy dough.
  4. Roll out as thin as you can with rolling pin.
  5. Dust the sheet very well, to prevent the dough from sticking during rolling.
  6. Roll through pasta roller 3 times.
  7. Fold the dough onto itself and repeat. During these rolls, take the opportunity to clean up the edges to get a rectangular sheet.
  8. Roll to thin settings, about 5 or 6 on KitcheAid. This is to your preference.
  9. Dust the sheet very well, to prevent sticking during cutting.
  10. Cut and dust again.
  11. Noodles can be cooked or frozen at this point.

This dough is very stiff and will make your pasta roller work hard. Be careful, it’s very possible to break your machine this way.

Corn starch can be used to dust the noodles, during rolling and cutting. This will prevent adding raw flour starch to the noodles when they cook.