title: Generating Jekyll pages from a folder of JSON
body: <p>So I have a bunch of cocktail recipes in a folder, each with a distinct name like screwdriver.json or adult-hot-chocolate.json with a correspondingly named image, and each recipe looks like this:</p>
  <pre><code>{
  &quot;name&quot;: &quot;Adult Hot Chocolate&quot;,
  &quot;description&quot;: &quot;Appropriately named 'adult hot chocolate', this recipe is one of the easiest and most common ways to spike your cocoa. To make it, you will simply add a shot of peppermint schnapps to your favorite hot chocolate and a delicious, warm drink is yours to enjoy.&quot;,
  &quot;github&quot;: &quot;thesanjeevsharma&quot;,
  &quot;ingredients&quot;: [
      {
          &quot;quantity&quot;: &quot;2&quot;,
          &quot;measure&quot;: &quot;oz&quot;,
          &quot;ingredient&quot;: &quot;Peppermint Schnapps&quot;
      },
      {
          &quot;quantity&quot;: &quot;6&quot;,
          &quot;measure&quot;: &quot;oz&quot;,
          &quot;ingredient&quot;: &quot;Hot Chocolate&quot;
      },
      {
          &quot;quantity&quot;: &quot;&quot;,
          &quot;measure&quot;: &quot;&quot;,
          &quot;ingredient&quot;: &quot;Garnish: ​whipped cream&quot;
      },
      {
          &quot;quantity&quot;: &quot;&quot;,
          &quot;measure&quot;: &quot;&quot;,
          &quot;ingredient&quot;: &quot;Garnish: chocolate sprinkles or shaved chocolate&quot;
      }
  ],
  &quot;directions&quot;: [
      &quot;Gather the ingredients.&quot;,
      &quot;Pour the schnapps into a warm mug or Irish coffee glass.&quot;,
      &quot;Fill with hot chocolate.&quot;,
      &quot;Stir well.&quot;,
      &quot;Optionally, top with whipped cream and chocolate sprinkles or shaved chocolate.&quot;,
      &quot;Serve and enjoy!&quot;
  ],
  &quot;image&quot;: &quot;adult-hot-chocolate.jpg&quot;,
  &quot;keywords&quot;: [
      &quot;chocolate&quot;,
      &quot;peppermint&quot;,
      &quot;schnapps&quot;
  ]
  }
  </code></pre>
  <p>I want to create a layout and randomly pick one recipe and image to show on my website. I know how to do it if they were all just in one big YAML document, but it’s not clear to me  how to tell Jekyll to parse separate files so I can reference one at random.</p>
  <p>The other possibility is to combine them into one big json but then I couldn’t just pull down new recipes as easily from the original source.</p>
  <p>Any help would be greatly appreciated!</p>