Skip to content

Instantly share code, notes, and snippets.

@rampatra
Last active January 30, 2020 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rampatra/a8650fd2ce43b7b1fb89bffa94ead603 to your computer and use it in GitHub Desktop.
Save rampatra/a8650fd2ce43b7b1fb89bffa94ead603 to your computer and use it in GitHub Desktop.
Fetching all jekyll posts in a json
---
layout: null
---
[
{% for post in site.posts %}
{
"title" : "{{ post.title }}",
"url" : "{{ post.url }}",
"date" : "{{ post.date | date: "%B %d, %Y" }}",
"content" : "{{ post.content | strip | strip_html | strip_newlines | replace: '"', '' | slice: 0, 600 }}"
}{% if forloop.last %}{% else %},{% endif %}
{% endfor %}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment