-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathpage-metadata.json
35 lines (30 loc) · 1.23 KB
/
page-metadata.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
---
permalink: /page-metadata
search: exclude
---
{% assign redirect-data = "redirect_from|redirect_to" | split:"|" %}
{% assign output-collections = site.collections | where:"output",true %}
{% assign permalink-docs = site.documents | where_exp:"page","page.permalink != nil" %}
{
"pages": [
{% for page in permalink-docs %}
{% if page.this-version %}
{% assign page-key = page.key | append: "-v" | append: page.this-version %}
{% else %}
{% assign page-key = page.key %}
{% endif %}
{% capture all-permalinks %}{{ page.permalink | strip }}{% if page.redirect_from %},{% if page.redirect_from[1] %}{% for url in page.redirect_from %}{{ url | replace_regex:'(#.*)',"" }}{%- unless forloop.last == true -%},{% endunless %}{% endfor %}{% else %}{{ page.redirect_from }}{% endif %}{% endif %}{% endcapture %}
{
"collection": "{{ page.collection }}",
"key": "{{ page-key }}",
"title": "{{ page.title }}",
"content_type": "{{ page.content-type }}",
"current_permalink": "{{ page.permalink | strip }}",
"all_permalinks": "{{ all-permalinks | strip }}",
"repo_url": "{{ page.repo-url }}",
"api_type": "{{ page.api-type }}",
"version": "{{ page.this-version }}"
}{% unless forloop.last == true %},{% endunless %}
{% endfor %}
]
}