Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List all posts, tags and categories in Jekyll. https://github.com/zhuochun/md-writer

Markdown-Writer for Atom

List all posts, tags and categories in Jekyll.

Octopress users: if you found " is escaped in the generated JSON file, please change them to \". Refer to this issue.

---
layout: null
---
{
"categories": [
{% for category in site.categories %}
"{{ category | first }}"{% unless forloop.last %},{% endunless %}
{% endfor %}
]
}
---
layout: null
---
{
"posts": [
{% for post in site.posts %}
{
"title": "{{ post.title | xml_escape }}",
"url": "{{ site.url }}{{ post.url }}",
"date": "{{ post.date | date_to_xmlschema }}"
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
}
---
layout: null
---
{
"tags": [
{% for tag in site.tags %}
"{{ tag | first }}"{% unless forloop.last %},{% endunless %}
{% endfor %}
]
}
@mautematico

This comment has been minimized.

Copy link

commented Feb 19, 2016

Thank you very much!

@JerryChin

This comment has been minimized.

Copy link

commented Jul 3, 2017

That's very helpful!

@MichaelOrtho

This comment has been minimized.

Copy link

commented May 13, 2018

Thank you, very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.