forked from mnyrop/annotate
-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
28 lines (28 loc) · 2.55 KB
/
index.html
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
---
layout: null
---
{% assign images = site.static_files | where_exp: 'item', 'item.path contains "/images/"' | sort_natural | map: 'path' %}
{% assign collections = site.pages | where_exp: 'item', 'item.dir == "/collections/"' | sort_natural %}
{% assign manifests = site.pages | where_exp: 'item', 'item.name contains "manifest.json"' %}
{% assign customviews = site.pages | where_exp: 'item', 'item.dir contains "customviews"' | sort_natural %}
{% assign imagearray = '' | split: "" %}
{% for image in images %}
{% unless image contains 'assets' or image contains 'derivatives'%}
{% assign item = image | prepend: site.baseurl | prepend: site.url %}
{% assign imagearray = imagearray | push: item %}
{% endunless %}
{% endfor %}
{"annotations": [{% for file in site.annotations %}{
{{'filename' | jsonify}}:{{site.url | append: site.baseurl | append: file.url| append: file.ext | jsonify}},{{'order' | jsonify}}:{{file.order | jsonify}}, {{'json' | jsonify}}:{{file.content | replace: "<", "<" | replace: ">", ">"}}
}{% unless forloop.last %},{% endunless %}{% endfor %}],
"manifests": [{% for manifest in manifests %}{
{{'url' | jsonify}}:{{site.url | append: site.baseurl | append: manifest.url| append: manifest.ext | jsonify}}, {{'iiif' | jsonify}}: {{true | jsonify}}, {{'upload' | jsonify}}: {{true | jsonify}},{{'added' | jsonify}}: {{manifest.added | jsonify}},{%if manifest.thumbnail%}{{'thumbnail' | jsonify }}: {{manifest.thumbnail | jsonify}}, {{'title' | jsonify }}: {{manifest.title | jsonify}}{% else %}{{'json' | jsonify}}:{{manifest.content | jsonify}}{%endif%}
}{% unless forloop.last %},{% endunless %}{% endfor %}], "images": {{imagearray| jsonify}},
"preloadedcontent": {{site.data.preload | jsonify}},
"customviews": [{% for customview in customviews %}{
{{'filename' | jsonify}}:{{site.url | append: site.baseurl | append: customview.url| jsonify}}, {{'editurl' | jsonify}}:{{customview.tagurl| jsonify}},{{'json' | jsonify}}:{{customview.content | replace: '<script src="https://ncsu-libraries.github.io/annona/dist/annona.js"></script>', '' | replace: '<link rel="stylesheet" type="text/css" href="https://ncsu-libraries.github.io/annona/dist/annona.css">', '' | replace: "<", "<" | replace: ">", ">" | jsonify}}
}{% unless forloop.last %},{% endunless %}{% endfor %}],
"collections": [{% for collection in collections %}{
{{'filename' | jsonify}}:{{site.url | append: site.baseurl | append: collection.url| jsonify}},{{'json' | jsonify}}:{{collection.content | replace: "<", "<" | replace: ">", ">"}}
}{% unless forloop.last %},{% endunless %}{% endfor %}]
}