ChickenKyiv / recipe-api-only

API server for recipe based projects. If you want to have an app or website with recipes, but don't want to spend a lot of time - this can be a good choice
https://recipe-api-loopback.herokuapp.com/
39 stars 12 forks source link

make stuff more friendly to ggoogle schema or to main scema. links below #147

Open atherdon opened 6 years ago

atherdon commented 6 years ago

https://developers.google.com/search/docs/data-types/recipe image https://search.google.com/structured-data/testing-tool

<!doctype html>
<html amp lang="en">
  <head>
    <meta charset="utf-8">
    <title>Strawberry-Mango Mesclun Recipe</title>
    <link rel="canonical" href="http://example.ampproject.org/recipe-metadata.html" />
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <script type="application/ld+json">
     {
      "@context": "http://schema.org/",
      "@type": "Recipe",
      "name": "Strawberry-Mango Mesclun Recipe",
      "image": [
        "https://example.com/photos/1x1/photo.jpg",
        "https://example.com/photos/4x3/photo.jpg",
        "https://example.com/photos/16x9/photo.jpg"
        ],
      "author": {
      "@type": "Person",
      "name": "scoopnana"
      },
      "datePublished": "2008-03-03",
      "description": "Mango, strawberries, and sweetened dried cranberries are a vibrant addition to mixed greens tossed with an oil and balsamic vinegar dressing.",
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "5",
        "reviewCount": "52"
      },
     "prepTime": "PT15M",
     "totalTime": "PT14M",
     "recipeYield": "12 servings",
     "nutrition": {
       "@type": "NutritionInformation",
       "servingSize": "1 bowl",
       "calories": "319 cal",
       "fatContent": "20.2 g"
     },
      "recipeIngredient": [
        "1/2 cup sugar",
        "3/4 cup canola oil",
        "1 teaspoon salt",
        "1/4 cup balsamic vinegar",
        "8 cups mixed salad greens",
        "2 cups sweetened dried cranberries",
        "1/2 pound fresh strawberries, quartered",
        "1 mango - peeled, seeded, and cubed",
        "1/2 cup chopped onion",
        "1 cup slivered almonds"
       ],
     "recipeInstructions": "\n1. Place the sugar, oil, salt, and vinegar in a jar with a lid. Seal jar, and shake vigorously to mix.\n2. In a large bowl, mix salad greens, sweetened dried cranberries, strawberries, mango, and onion. To serve, toss with dressing and sprinkle with almonds."
     }
   </script>
  </head>
  <body>
    <h1>The best strawberry and mango mesclun you’ll ever try!</h1>
  </body>
</html>

http://schema.org/Recipe http://schema.org/suitableForDiet https://jsonld.com/recipe/

atherdon commented 6 years ago

https://github.com/krg7880/json-schema-generator