Skip to content

Commit

Permalink
Return better and more data
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaandotcom committed Nov 12, 2023
1 parent 67ca8c0 commit 2589f8b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
12 changes: 0 additions & 12 deletions _docs/00_releases/v2.md

This file was deleted.

46 changes: 29 additions & 17 deletions pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,34 @@ layout: null
permalink: /pages.json
---
{
"url": "{{ site.url }}",
"pages": [
{% assign counter = 0 -%}
{%- for post in site.docs limit:1000 -%}
{%- 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 %}{
"{{ post.url }}": {{ post.content | markdownify | strip_html | jsonify | remove: '\"' }}
}
"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 -%}
{%- endfor %}
]
{%- 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 %}
]
}

0 comments on commit 2589f8b

Please sign in to comment.