How to Insert Ethical Ads into Your Slate API Docs

For those who don’t know Slate helps you create beautiful, intelligent, responsive API documentation. They were inspired by Stripe’s API Docs and are used by open source projects to large enterprise & government institutions. Let’s get started!

Setup Slate

They have great documentation on how to get up and running here:

Steps to integrate CodeFund

Login to your CodeFund account and create a new property and fill out the required fields. For the template, choose image-only. Once we have more templates we will update this post. ?

Afterwards, you must copy the embed code under the Instructions tab

Next, you can add the code to your website. For good web performance, it’s best to put your JavaScript at the bottom.

Open up source/layouts/layout.erb and right above </body> add the JavaScript snippet.

Now we will add the other snippet in source/

Now refresh the page (http://localhost:4567) and you should see the CodeFund ad! ?

And there you have it. Your awesome API Docs rocking Ethical Ads ?

Photo by Mat Reding



Share This