Last active
December 8, 2017 06:49
-
-
Save stuartbreckenridge/142fdcc8736f33e36d407746f2607169 to your computer and use it in GitHub Desktop.
JSON Feed for Jekyll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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