-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathfeed.json
53 lines (47 loc) · 1.93 KB
/
feed.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
45
46
47
48
49
50
51
52
53
---
layout: json
---
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ site.title | xml_escape }}",
"home_page_url": "{{ "/" | absolute_url }}",
"feed_url": "{{ "/feed.json" | absolute_url }}",
"description": {{ site.description | jsonify }},
"icon": "{{ "/apple-touch-icon.png" | absolute_url }}",
"favicon": "{{ "/favicon.ico" | absolute_url }}",
"expired": false,
"author": {
"name": {{ site.author.name | jsonify }},
"url": {{ site.author.url | jsonify }},
"avatar": {{ site.author.avatar | jsonify }}
},
"items": [
{% assign posts = site.posts | where_exp: "post", "post.draft != true" %}
{% for post in posts limit: 10 %}
{
"id": "{{ post.url | absolute_url | md5 }}",
"title": {{ post.title | smartify | strip_html | normalize_whitespace | jsonify }},
"url": "{{ post.url | absolute_url }}",
"date_published": "{{ post.date | date_to_xmlschema }}",
"date_modified": "{{ post.modified | default: post.date | date_to_xmlschema }}",
"author": {
"name": {{ site.author.name | jsonify }}
},
{% assign tag_array = post.tags %}
{% for category in post.categories %}
{% assign tag_array = tag_array | push: category %}
{% endfor %}
"tags": {{ tag_array | sort | uniq | jsonify }},
{% assign post_image = post.header.teaser | absolute_url | xml_escape %}
"image": "{{ post_image }}",
{% assign post_banner = post.header.image | absolute_url | xml_escape %}
"banner_image": "{{ post_banner }}",
{% assign content_text = post.description | strip_html | strip_newlines | normalize_whitespace | jsonify %}
"content_text": {{ content_text }},
{% assign content_html = post.content | strip_newlines | normalize_whitespace | jsonify %}
"content_html": {{ content_html }}
}
{% unless forloop.last %},{% endunless %}
{% endfor %}
]
}