How the recipe shortcodes work

Overview

The ingredient and step data lives entirely in front matter. The shortcodes read it and render it — no repeated data in the body. This keeps your content clean and makes the structured data for search engines automatic.

If your site uses recipes, this approach means you write data once and it appears in both the rendered page and the JSON-LD schema block in the <head>.

Front matter structure:

recipe = true
recipeCuisine = "Breakfast"
prepTime = "PT10M"      # ISO 8601 duration
cookTime = "PT50M"
totalTime = "PT1H"
recipeYield = "3 Cups"
calories = 70

recipeIngredients = [
  "2 C. oats",
  "1/4 cup honey",
  # prefix a line with ** to render it as a subheading
  "**Dry goods",
]

[[recipeInstructions]]
  name = "mix"      # used as the anchor ID and step label
  text = "Mix everything together."
  image = "path/to/step-image.webp"  # optional

Shortcode usage:

{{{{<<rreecciippee--ihnogwrteod-isetnetpss--lliisstt>>}}}}

Setting recipe = true also enables the Schema.org/Recipe JSON-LD block in the page <head> for structured data / search engine rich results.


Here’s a live example using the front matter on this page:

Lemon Chia Granola
Lemon Chia Granola

A bright, lemony granola with chia seeds. Low and slow baking and a weighted press gives you satisfying clusters.

Ingredients

No ingredients listed.

Instructions

1

mix

Mix all ingredients in a bowl, ensuring oats and seeds are fully coated in the liquid. Add zest from 1 lemon now.

2

spread

Spread evenly over a large baking pan lined with parchment paper.

3

bake

Bake at 290°F for 50 minutes. Do not stir.

4

press

Remove from oven, scatter dried fruit on top, then cover with another sheet of parchment and a second pan to press down for clumpier granola.

5

zest

Add zest from the second lemon.

6

cool

Let cool completely in the pan, then break apart into clumps.

Enjoy

Eat alone, mixed with fruit and yogurt, or with milk as cereal.