Scale Val Shortcode#
Display a value that automatically scales with a recipe.
Usage#
This recipe makes {{< scale-val id="cookies" val="24" >}} cookies.
{{< scale-input id="cookies" >}}
{{< recipe id="cookies" >}}
- 2 cups flour
{{< /recipe >}}Parameters#
| Parameter | Required | Description |
|---|---|---|
id | Yes | Must match the recipe id |
val | Yes | Base value to scale (supports whole numbers, decimals, fractions, and mixed fractions) |
Features#
- Automatic updates: Value changes when recipe scale changes
- Fraction support: Handles fractions (1/2, 3/4), mixed fractions (1 1/2), whole numbers, and decimals
- Smart formatting: Scaled values display as nice fractions (1/4, 1/3, 1/2, 2/3, 3/4) or whole numbers
- Multiple instances: Can be used multiple times with same id
- Inline display: Appears naturally within text
Common Use Cases#
- Recipe yield: “Makes 24 cookies”
- Serving size: “Serves 6 people”
- Container count: “Fills 3 jars”
- Fractional measurements: “Add 1/2 cup of sauce”
- Mixed measurements: “Cook for 1 1/2 hours”
Examples#
Mix in {{< scale-val id="recipe" val="1/2" >}} cup of sauce
Bake for {{< scale-val id="recipe" val="45" >}} minutes
Makes {{< scale-val id="recipe" val="8" >}} servings
Add {{< scale-val id="recipe" val="1 1/2" >}} cups flourWhen scaled to 2x:
1/2becomes145becomes908becomes161 1/2becomes3
Notes#
- The
idmust match the recipe it’s linked to - Accepts whole numbers (
24), decimals (1.5), fractions (1/2), and mixed fractions (1 3/4) - Scaled values are rounded to nearest common fraction (1/4, 1/3, 1/2, 2/3, 3/4) or whole number
- Can appear before or after the recipe shortcode in the page
- Multiple scale-val shortcodes can share the same id
- Backward compatible with existing integer-only usage