I use the Middleman data files feature for my chess site.
These files are written in yaml.
I could have used json directly for these which would have removed the need for this post but I find yaml is easier for manual editing - with json you constantly have to worry about matching up brackets.
From the Middleman erb files, when I build locally I am able to access things like
To load the remote file I just use the JQuery Ajax get function and pass it the url of the file that I want.
Then I use the js-yaml library to parse the result and create a
data json object from this.
1 2 3 4 5 6