-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.json
44 lines (43 loc) · 1.99 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
---
layout: null
---
{
"website_title": "{{ site.title | xml_escape }}",
"website_url": "{{ "/" | absolute_url }}",
"posts": [
{% for post in site.posts %}
{
"title": {{ post.title | jsonify }},
"content_text": {{ post.content | strip_html | strip_newlines | jsonify }},
"content_html": {{ post.content | strip_newlines | jsonify }},
"url": "{{ post.url | absolute_url }}",
{% if post.image.size > 0 %}
"image": {{ post.image | jsonify }},{% endif %}
{% if post.categories.size > 0 %}
"categories": {{ post.categories | jsonify }},{% endif %}
{% if post.tags.size > 0 %}
"tags": {{ post.tags | jsonify }},{% endif %}
"date_published": "{{ post.date | date_to_xmlschema }}",
"date_modified": "{{ post.date | date_to_xmlschema }}",
{% if post.author %}
"author": {% if post.author.name %} "{{ post.author.name }}" {% else %} "{{ post.author }}" {% endif %}
{% else %}
"author": {% if site.author.name %} "{{ site.author.name }}" {% else %} "{{ site.author }}" {% endif %}
{% endif %}
}{% if forloop.last == false %},{% endif %}
{% endfor %}
],
"pages": [
{% for page in site.pages %}
{
"id": {{page.title | downcase | jsonify}},
"title": {{ page.title | jsonify }},
"content_text": {{ page.content | strip_html | strip_newlines | jsonify }},
"content_html": {{ page.content | strip_newlines | jsonify }},
"url": "{{ page.url | absolute_url }}",
"date_published": "{{ page.date | date_to_xmlschema }}",
"date_modified": "{{ page.date | date_to_xmlschema }}"
}{% if forloop.last == false %},{% endif %}
{% endfor %}
]
}