Skip to content

Instantly share code, notes, and snippets.

@jordanmerrick
Created May 20, 2017 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordanmerrick/ac3e2ecff70ad0c2142037805f286e0f to your computer and use it in GitHub Desktop.
Save jordanmerrick/ac3e2ecff70ad0c2142037805f286e0f to your computer and use it in GitHub Desktop.
JSON feed template for Jekyll.
---
layout: null
---
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ site.title | xml_escape }}",
"home_page_url": "{{ site.url }}",
"icon": "{{site.url }}/media/icons/apple-touch-icon.png",
"favicon": "{{ site.url }}/media/icons/favicon.ico",
"feed_url": "{{ site.url }}/feed.json",
"author": {
"name": "Jordan Merrick",
"url": "https://twitter.com/jordanmerrick"
},
"items": [
{% for post in site.posts limit:10 %}
{
"title": {{ post.title | jsonify }},
"id": "{{ post.url | prepend: site.baseurl | prepend: site.url }}",
"date_published": "{{ post.date | date_to_xmlschema }}",
"date_modified": "{{ post.date | date_to_xmlschema }}",
"url": "{{ post.url | prepend: site.baseurl | prepend: site.url }}",
{% if post.link != null %}
"external_url": "{{ post.link }}",
{% endif %}
"content_html": {{ post.content | strip_newlines | jsonify }}
}{% if forloop.last == false %},{% endif %}
{% endfor %}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment