-
Notifications
You must be signed in to change notification settings - Fork 15
/
pages.json
36 lines (36 loc) · 1.29 KB
/
pages.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
---
layout: null
permalink: /pages.json
---
{
"url": "{{ site.url }}",
"docs": [
{% assign counter = 0 -%}
{%- assign docs = site.docs | sort: 'path' -%}
{%- for post in docs -%}
{%- if post.draft or counter >= 1000 -%}
{%- assign match = false -%}
{%- else -%}
{%- assign match = true -%}
{%- assign counter = counter | plus:1 -%}
{%- endif -%}
{%- if match -%}
{%- if counter > 1 %},
{% endif -%}
{%- assign segments = post.path | split: '/' -%}
{%- assign filename_with_extension = segments | last -%}
{%- assign filename_parts = filename_with_extension | split: '_' -%}
{%- assign order = filename_parts[0] -%}
{%- assign name_with_extension = filename_parts[1] -%}
{%- assign name = name_with_extension | split: '.' | first -%}
{%- if post.hidden or order == '00' -%}
{%- assign hidden = true -%}
{%- else -%}
{%- assign hidden = false -%}
{%- endif -%}{
"{{ site.url }}{{ post.url }}": {"body": {{ post.content | markdownify | strip_html | jsonify | replace: ' ', ' ' | replace: ' ', ' ' | replace: ' ', ' ' | replace: ' ', ' ' | replace: ' ', ' ' | replace: ' \n', '\n' | replace: '\n ', '\n' | replace: '\n\n', '\n' | replace: '\n\n', '\n' | remove: '\"' | trim }},"hidden":"{{ hidden }}", "order":"{{ order }}","category":"{{ post.category }}"}
}
{%- endif -%}
{%- endfor %}
]
}