Skip to content

Commit

Permalink
Add JSON Feed.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinvoss committed May 27, 2017
1 parent 1836cee commit 39f0f69
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _includes/footer.html
@@ -1,6 +1,6 @@
<div id="footer">
<div class="page">
<p id="atomlink"><a href="/atom.xml" title="Atom XML Feed">Subscribe - Atom XML</a></p>
<p id="atomlink">Subscribe - <a href="/atom.xml" title="Atom XML Feed">Atom XML</a> or <a href="/feed.json">JSON Feed</a></p>
<p>Comments, corrections, and anything else can be sent to <a href="mailto:justin@bleedingwolf.com">justin@bleedingwolf.com</a>.</p>
<p>Follow me on <a href="http://twitter.com/justinvoss" rel="me">Twitter</a>.</p>
</div>
Expand Down
1 change: 1 addition & 0 deletions _layouts/default.html
Expand Up @@ -26,6 +26,7 @@
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon-precomposed.png">

<link rel="alternate" type="application/atom+xml" href="/atom.xml">
<link rel="alternate" type="application/json" href="/feed.json" />

<meta name="author" value="Justin Voss">

Expand Down
20 changes: 20 additions & 0 deletions feed.json
@@ -0,0 +1,20 @@
---
---
{
"version": "https://jsonfeed.org/version/1",
"title": "Justin Voss",
"home_page_url": "http://justinvoss.com/",
"feed_url": "http://justinvoss.com/feed.json",
"icon": "http://justinvoss.com/apple-touch-icon-precomposed.png",
"items": [
{% for post in site.posts %}
{
"title": {{ post.title | jsonify }},
"date_published": "{{ post.date | date_to_xmlschema }}",
"id": "http://justinvoss.com{{ post.id }}",
"url": "http://justinvoss.com{{ post.url }}",
"content_html": {{ post.content | jsonify }}
} {% unless forloop.last %},{% endunless %}
{% endfor %}
]
}

0 comments on commit 39f0f69

Please sign in to comment.