Skip to content

Commit

Permalink
feat(template): add JSON output support
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Aug 24, 2015
1 parent 0553e2d commit 8c88fec
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 10 deletions.
1 change: 0 additions & 1 deletion TODOS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Todos

- RSS feed template
- Cleanup `plugin_intense_class`
- try load-grunt-config
- only update AMSF in release branch?
9 changes: 9 additions & 0 deletions _app/_includes/_amsf.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{% comment %}
Post author meta
{% endcomment %}
{% if post.author %}
{% assign author = site.data.authors[post.author] %}
{% else %}
{% assign author = site.data.authors["default"] %}
{% endif %}

{% comment %}
Page author meta
{% endcomment %}
Expand Down
2 changes: 1 addition & 1 deletion _app/_posts/note/2014-06-11-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: Configuration
category: note
tag: getting-started
tags: getting-started
---

## Configuration SettingsPermalink
Expand Down
2 changes: 1 addition & 1 deletion _app/_posts/note/2014-06-12-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: Getting Started
category: note
tag: getting-started
tags: getting-started
---

## Requirements
Expand Down
2 changes: 1 addition & 1 deletion _app/_posts/note/2014-06-13-welcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: Welcome
category: note
tag: getting-started
tags: getting-started
---

AMSF, a.k.a. **Almace Scaffolding**, is a super-fast Jekyll framework, supports live reloading (Browsersync), Less, HTML minification, inlined stylesheets and more.
Expand Down
6 changes: 0 additions & 6 deletions _app/feed-atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ permalink: /feed.xml
{% endif %}
{% endcapture %}

{% if post.author %}
{% assign author = site.data.authors[post.author] %}
{% else %}
{% assign author = site.data.authors["default"] %}
{% endif %}

<entry>
<title>{{ post.title | strip_html | xml_escape }}</title>
<id>{{ post.url | prepend: amsf_site_base | xml_escape }}</id>
Expand Down
36 changes: 36 additions & 0 deletions _app/feed-json.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
permalink: /feed-json.json
---

[

{% assign first = true %}
{% include _amsf.html %}

{% for post in site.posts %}
{% if post.hidden != true %}
{% unless first %},{% endunless %}
{
"title": {{ post.title | jsonify }},
"permalink": {{ post.url | prepend: amsf_site_base | jsonify }},
"link": {{ post.url | prepend: amsf_site_base | jsonify }},
"date": {{ post.date | date_to_xmlschema | jsonify }},
{% if post.last_modified_at %}
"modified": {{ post.last_modified_at | date_to_xmlschema | jsonify }},
{% endif %}
"author": {
"name": {{ author.name | jsonify }},
"url": {{ author.web | jsonify }},
"email": {{ author.email | jsonify }}
},
"content": {{ post.content | markdownify | strip_html | jsonify }},
"excerpt": {{ post.excerpt | markdownify | strip_html | jsonify }},
"languages": {{ post.languages | jsonify }},
"categories": {{ post.categories | jsonify }},
"tags": {{ post.tags | jsonify }}
}
{% assign first = false %}
{% endif %}
{% endfor %}

]

0 comments on commit 8c88fec

Please sign in to comment.