forked from AtiusAmy/atiusamy.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
feed.json
executable file
·51 lines (51 loc) · 1.6 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
---
layout: uglify
---
{
"lastBuildDate": "{{ site.time | date_to_rfc822 }}",
"generator": "Jekyll v{{ jekyll.version }}",
"posts": [
{% assign counter = 0 %}
{% for post in site.posts %}
{% unless post.hidden %}
{% assign counter = counter | plus: 1 %}
{% unless counter > 3 %}
{
"url": "{{ post.url | prepend: site.baseurl | prepend: site.url }}",
"title": {{ post.title | jsonify }},
"pubDate": "{{ post.date | date_to_rfc822 }}",
{% if post.description %}
"description": {{ post.description | jsonify }},
{% endif %}
"author": {
{% if site.authors[post.author].name %}
{% assign author=site.authors[post.author] %}
{% endif %}
{% if author.gravatar %}
"gravatar": "{{ author.gravatar }}",
"name": "{{ author.name }}"
{% else %}
"gravatar": "{{ site.gravatar }}",
"name": "elementary"
{% endif %}
},
{% if post.image %}
{% assign prefix = post.image | slice: 0, 4 %}
{% if prefix == "http" %}
{% assign image = post.image %}
{% else %}
{% assign image = post.image | prepend: site.baseurl | prepend: site.url %}
{% endif %}
"image": "{{ image }}",
{% else %}
"excerpt": "{{ post.excerpt | strip_html | truncatewords: 40 | jsonify }}",
{% endif %}
{% assign words = post.content | strip_html | number_of_words %}
"read_time": "{{ words | divided_by: 200 | plus: 1 }} min read"
}
{% unless counter >= 3 %},{% endunless %}
{% endunless %}
{% endunless %}
{% endfor %}
]
}