Created
December 25, 2015 12:49
-
-
Save gest01/07bca50327c7f3bea387 to your computer and use it in GitHub Desktop.
generates a json file with all blog posts and tags for the Jekyll blogging engine (http://jekyllrb.com/)
This file contains 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
--- | |
layout: null | |
--- | |
{ | |
"tags" : | |
[ | |
{% for tag in site.tags %} | |
{% assign t = tag | first %} | |
{% assign posts = tag | last %} | |
"{{ t }}" {% if forloop.last %}{% else %},{% endif %} | |
{% endfor %} | |
] | |
,"posts" : [ | |
{% for post in site.posts %} | |
{ | |
"id" : "{{ post.id }}", | |
"title" : "{{ post.title }}", | |
"url" : "{{ site.url }}{{ post.url }}", | |
"date" : "{{ post.date | date: "%B %d, %Y" }}", | |
"date2" : "{{ post.date | date:"%d.%m.%Y" }}", | |
"tags" : | |
[ | |
{% for tag in post.tags %} | |
"{{ tag }}" {% if forloop.last %}{% else %},{% endif %} | |
{% endfor %} | |
] | |
} {% if forloop.last %}{% else %},{% endif %} | |
{% endfor %} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment