Schema

Recipe

Schema.org Recipe

  • Type: defineRecipe(input?: Recipe)
    Describes a Recipe, which contains a series of instructions, ingredients, and optional fields.
  • Component: SchemaOrgRecipe (see how components work)

Required properties

  • name string
    A string describing the recipe.
    A name can be provided using route meta on the title key, see defaults.
  • image string|ImageObject
    An image representing the completed recipe, referenced by ID.
    A single image URL can be provided using route meta on the image key, see defaults.
  • recipeIngredient string[]
    An array of strings representing each ingredient and quantity (e.g., "3 apples").
  • recipeInstructions Arrayable<HowToStepInput>
    An array of instructions for how to prepare the recipe.

Defaults

  • @type: Recipe
  • @id: ${canonicalUrl}#recipe
  • name: currentRouteMeta.title (see: Schema.org Params)
  • image: currentRouteMeta.image (see: Schema.org Params)
  • description: currentRouteMeta.description (see: Schema.org Params)
  • inLanguage: options.defaultLanguage (see: user Config)
  • datePublished: currentRouteMeta.datePublished (see: Schema.org Params)
  • author: (conditional) set to the current page article's author if one exists
  • mainEntityOfPage: WebPage Reference

Resolves

See Global Resolves for full context.

  • datePublished can be resolved from Date objects

Minimal

defineRecipe({
  name: 'Peanut Butter Cookies',
  image: 'https://example.com/photos/1x1/photo.jpg',
  recipeInstructions: [
    {
      text: 'Bake at 200*C for 40 minutes, or until golden-brown, stirring periodically throughout',
    },
    {
      text: 'Eat them up',
    },
  ],
  recipeIngredient: ['Peanut Butter', 'Cookie Dough'],
})

Types

export interface RecipeSimple extends Thing {
  /**
   * A string describing the recipe.
   */
  name?: string
  /**
   * An image representing the completed recipe, referenced by ID.
   */
  image?: NodeRelation<ImageObject | string>
  /**
   * An array of strings representing each ingredient and quantity (e.g., "3 apples").
   */
  recipeIngredient: string[]
  /**
   * An array of HowToStep objects.
   */
  recipeInstructions: NodeRelations<HowToStep | string>
  /**
   * A string describing the recipe.
   */
  description?: string
  /**
   * The cooking time in ISO 8601 format.
   */
  cookTime?: string
  /**
   * The time required to prepare the recipe.
   */
  prepTime?: string
  /**
   * A NutritionInformation node, with a calories property which defines a calorie count as a string (e.g., "270 calories").
   */
  nutrition?: NutritionInformation
  /**
   * The number of servings the recipe creates (not the number of individual items, if these are different), as a string
   * (e.g., "6", rather than 6).
   */
  recipeYield?: string
  /**
   * An array of strings representing the tools required in the recipe.
   */
  tools?: string[]
  /**
   * An array of keywords describing the recipe.
   */
  keywords?: string[]
  /**
   * A string describing the cuisine type (e.g., "American" or "Spanish").
   */
  recipeCuisine?: string
  /**
   * The category of the recipe.
   */
  recipeCategory?: 'Appetizer' | 'Breakfast' | 'Brunch' | 'Dessert' | 'Dinner' | 'Drink' | 'Lunch' | 'Main course' | 'Sauce' | 'Side dish' | 'Snack' | 'Starter'
  /**
   * A RestrictedDiet node, with a value (or array of values
   */
  suitableForDiet?: Partial<'DiabeticDiet' | 'GlutenFreeDiet' | 'HalalDiet' | 'HinduDiet' | 'KosherDiet' | 'LowCalorieDiet' | 'LowFatDiet' | 'LowLactoseDiet' | 'LowSaltDiet' | 'VeganDiet' | 'VegetarianDiet'>[]
  /**
   *  A reference to a video representing the recipe instructions, by ID.
   */
  video?: NodeRelations<VideoObject | IdReference>
  /**
   * The language code for the guide; e.g., en-GB.
   */
  inLanguage?: string
  /**
   * A reference-by-ID to the author of the article.
   */
  author?: NodeRelation<Person>
  /**
   * The date when the recipe was added, in ISO 8601 format.
   */
  datePublished?: ResolvableDate
}

export interface NutritionInformation extends Thing {
  '@type': 'NutritionInformation'
  /**
   * A calorie count as a string (e.g., "270 calories").
   */
  'calories': string
}