Skip to content

Instantly share code, notes, and snippets.

@Dagimal
Created March 18, 2024 01:39
Show Gist options
  • Select an option

  • Save Dagimal/d271224733a08bd32d47623a80076a01 to your computer and use it in GitHub Desktop.

Select an option

Save Dagimal/d271224733a08bd32d47623a80076a01 to your computer and use it in GitHub Desktop.
hugo site schema for recipes
// https://developers.google.com/search/docs/appearance/structured-data/recipe
{
"@context": "https://schema.org/",
"@type": "Recipe",
"name": "{{ .Title }}",
"image": [
"{{ .Params.thumbnail }}"
],
"author": {
"@type": "Person",
"name": "CahKlaten"
},
"datePublished": "{{ .Params.date }}",
"description": "{{ .Title }}",
//"recipeCuisine": "American",
"prepTime": "{{ .Params.prepTime }}",
"cookTime": "{{ .Params.cookTime }}",
//"totalTime": "PT3M",
"keywords": "{{ .Title }}",
"recipeYield": "{{ .Params.yield }} servings",
"recipeCategory": "Food & Drink",
"nutrition": {
"@type": "NutritionInformation",
"calories": "{{ .Params.calories }} calories"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{{ .Params.ratingValue }}",
"ratingCount": "{{ .Params.ratingCount }}"
},
"recipeIngredient": [
{{ range .Params.ingredientFront }}
{{ . }},
{{ end }}
],
"recipeInstructions": [
{{ range .Params.ingredientFront }}
{{ . }},
{{ end }}
],
//"video": {
// "@type": "VideoObject",
// "name": "How to Make a Non-Alcoholic Piña Colada",
// "description": "This is how you make a non-alcoholic piña colada.",
// "thumbnailUrl": [
// "https://example.com/photos/1x1/photo.jpg",
// "https://example.com/photos/4x3/photo.jpg",
// "https://example.com/photos/16x9/photo.jpg"
// ],
// "contentUrl": "https://www.example.com/video123.mp4",
// "embedUrl": "https://www.example.com/videoplayer?video=123",
// "uploadDate": "2018-02-05T08:00:00+08:00",
// "duration": "PT1M33S",
// "interactionStatistic": {
// "@type": "InteractionCounter",
// "interactionType": { "@type": "WatchAction" },
// "userInteractionCount": 2347
// },
// "expires": "2019-02-05T08:00:00+08:00"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment