iilab / contentascode

Content as Code
http://iilab.github.io/contentascode
GNU General Public License v3.0
34 stars 7 forks source link

Allow transclusion of API endpoint results #42

Open jmatsushita opened 8 years ago

jmatsushita commented 8 years ago

This could be an underlying facility for #40 or #41 where the source of a page could describe an API endpoint (ideally serving a JSON object) and some form of templating to display data.

For instance:


---
source: https://github.com/api/blahblah
layout: issues

---
each issue in issues
  li= issue.name
    a(href=issue.link) issue.description

This should be fairly easy with Metalsmith and the metadata plugin after an API fetch to file step, or by creating a plugin that directly consumes the API at each generation run (which could be based on the contentful or primsic metalsmith plugins which do this).