Skip to content

troyblank/foodhow

Repository files navigation

Food How

Build Status Coverage Status

Food how is a recipe book and shopping list that deploys as static files. For more information see troyblank.com.

Requirements

  • node: 10.16.2

Setup

First thing you want to do is install all node packages run:

yarn install

In order to build and run the project run:

yarn start

Test

yarn test

Adding recipes

To add a recipe simply make a new json file in static/recipes that follows this format:

{
    "title": "Some Food",
    "meta": "This is a really good food.",
    "ingredients": [
        "[1 link to another recipe](/some/link)",
        "1 meat",
        "1 cup fruit (processed)",
        "½ tsp spice"
    ],
    "directions": [
        { "text": "Mash ingredient together." },
        { "text": "Maybe throw in hot sauce (optional).", type: "optional" },
        { "text": "Eat." }
    ]
}

Then add the new recipe to the list in static/recipes.js

When adding recipes it's important to note that underscores will be used in lieu of spaces in file names. For example "Some_Food.json" will show up as "Some Food" to the user.

Additional recipe formats

Ingredient groups:

{
    ...
    "directions": [
        [
            { "text": "Mash ingredient together." },
            { "text": "Put in a fridge for 24 hours." },
        ]m
        { "text": "Maybe throw in hot sauce (optional).", type: "optional" },
        { "text": "Eat." }
    ]
    ...
}

Additional direction formats (experimental - need to make this more like ingredients in the future)

Direction groups:

{
    ...
   "directions": {
        "Brine": [
            "1 15lb turkey",
            "1 gallon vegetable stock"
        ],
        "Stuffing": [
            "4 sprigs rosemary",
            "6 leaves sage"
        ]
    },
    ...
}   

Types

Recipe type

property description type
title Title of recipe string
meta Subtext for recipe string
ingredients List of ingredients [string] | object
directions List of directions [direction]

Direction type

property description type values
text The step instructions string
type Puts emphasis on how the step is displayed string "normal" (default), or "optional"

About

Food how is a static recipe book that uses json files for storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors