Example 22: The Context Field

Controlling which content directory resolves each token

Demo: All Three Context Strategies

Each of the three colored widgets below comes from a different content source — controlled by the context field.

1. Root context (context = "_")

Step config: emoji = "🏠", context = "_", path = "content/"
Resolves: content/header.html (the same header on every page)

2. Named context (context = "product")

Step config: emoji = "📦", context = "product", path = "content/product/"
Resolves: content/product/description.html (shared by all product pages regardless of name)

3. Default (no context field)

Step config: emoji = "📝", no context, path = "content/pages/"
Resolves: content/pages/product-laptop/note.html (found because this page is named product-laptop.html)