-
Notifications
You must be signed in to change notification settings - Fork 2
/
stats.json
26 lines (26 loc) · 976 Bytes
/
stats.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
---
---
{
"posts": [
{%- assign word_count = 0 -%}
{%- assign this_word_count = 0 -%}
{%- for post in site.posts -%}
{
"title": {{ post.title | jsonify }},
"url": {{ post.url | absolute_url | jsonify }},
"date": {{ post.date | jsonify }},
"categories": {{ post.categories | jsonify }},
{%- assign this_word_count = post.content | strip_html | number_of_words | minus: 5 -%}
{%- assign word_count = word_count | plus: this_word_count -%}
"word_count": {{ this_word_count | jsonify }},
"reading_time_mn": {{ this_word_count | divided_by: 170.0 | ceil | jsonify }}
}{%- unless forloop.last -%},{%- endunless -%}
{%- endfor -%}
],
"stats": {
"category_count": {{ site.categories | size | jsonify }},
"post_count": {{ site.posts | size | jsonify }},
"word_count": {{ word_count | jsonify }},
"reading_time_mn": {{ word_count | divided_by: 170.0 | ceil | jsonify }}
}
}