Skip to content

Commit 39f0f69

Browse files
committed
Add JSON Feed.
1 parent 1836cee commit 39f0f69

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

_includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="footer">
22
<div class="page">
3-
<p id="atomlink"><a href="/atom.xml" title="Atom XML Feed">Subscribe - Atom XML</a></p>
3+
<p id="atomlink">Subscribe - <a href="/atom.xml" title="Atom XML Feed">Atom XML</a> or <a href="/feed.json">JSON Feed</a></p>
44
<p>Comments, corrections, and anything else can be sent to <a href="mailto:justin@bleedingwolf.com">justin@bleedingwolf.com</a>.</p>
55
<p>Follow me on <a href="http://twitter.com/justinvoss" rel="me">Twitter</a>.</p>
66
</div>

_layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon-precomposed.png">
2727

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

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

feed.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
---
3+
{
4+
"version": "https://jsonfeed.org/version/1",
5+
"title": "Justin Voss",
6+
"home_page_url": "http://justinvoss.com/",
7+
"feed_url": "http://justinvoss.com/feed.json",
8+
"icon": "http://justinvoss.com/apple-touch-icon-precomposed.png",
9+
"items": [
10+
{% for post in site.posts %}
11+
{
12+
"title": {{ post.title | jsonify }},
13+
"date_published": "{{ post.date | date_to_xmlschema }}",
14+
"id": "http://justinvoss.com{{ post.id }}",
15+
"url": "http://justinvoss.com{{ post.url }}",
16+
"content_html": {{ post.content | jsonify }}
17+
} {% unless forloop.last %},{% endunless %}
18+
{% endfor %}
19+
]
20+
}

0 commit comments

Comments
 (0)