Skip to content

Instantly share code, notes, and snippets.

@ryanhalliday
Created December 31, 2014 05:38
Show Gist options
  • Save ryanhalliday/b0187cb386bad961bf5d to your computer and use it in GitHub Desktop.
Save ryanhalliday/b0187cb386bad961bf5d to your computer and use it in GitHub Desktop.
Jekyll file-based Posts API
---
layout: null
---
[
{% for post in site.posts %}
{
"slug":{{post.title | slugify}}
"url":"{{site.url}}{{post.url}}",
"title":"{{post.title}}",
"date":,"{{post.date}}"
"categories":[{% for categories in post.categories %}"{{categories}}"{% if forloop.rindex0 > 0 %}, {% endif %}{% endfor %}],
"excerpt":"{{post.excerpt | strip_html}}"
}{% if forloop.rindex0 > 0 %},{% endif %}
{% endfor %}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment