-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapi.json
31 lines (28 loc) · 837 Bytes
/
api.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
limit: 100
---
[
{%- for post in site.posts limit: page.limit -%}
{
"title": "{{ post.title }}",
"date": "{{ post.date | date: "%B %d, %Y" }}",
"author": "{{ post.author }}",
{% if post.categories %} "categories" : [
{%- for category in post.categories -%} "{{ category }}"
{% if forloop.last %}{% else %},{% endif %}
{% endfor %}
],
{% endif %}
{% if post.categories == nil %} "categories" : [], {% endif %}
"url": "{{ post.url }}",
{% if post.tags %} "tags" : [
{%- for tag in post.tags -%} "{{ tag }}"
{%- if forloop.last -%}{% else %},{% endif %}
{% endfor %}
]
{% endif %}
{%- if post.tags == nil -%} "tags" : [] {% endif %}
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
]