Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
JSON Feed for Jekyll
---
sitemap: false
---
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ site.title }}",
"home_page_url": "{{ site.url }}/",
"feed_url": "{{ site.url }}/feed.json",
"author": {
"name": "{{ site.author }}"
},
"items": [
{% for post in site.posts limit:20 %}
{
"id": "{{ post.identifier }}",
"title": "{{ post.title | cdata_escape }}",
"content_html": {{ post.content | jsonify }},
"url": "{{ site.url }}/{{ post.url }}",
"summary": "{{ post.excerpt }}",
{% if post.link %}"external_url": "{{ post.link }}",{% endif %}
{% if post.image %}"image": "{{ post.image }}",{% endif %}
"tags": ["{{ post.tags}}"],
"date_published": "{{ post.date | date_to_xmlschema }}"
}{% if forloop.last == false %},{% else %}{% endif %}{% endfor %}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment