-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathobject.html
97 lines (97 loc) · 4.87 KB
/
object.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html>
{% include head.html %}
<body>
{% include header.html %}
<div class="container content single">
<div class="highlight">
{% if page.object_name %}{{ page.object_name }}{% else %}{{ site.moto | newline_to_br }}{% endif %}
</div>
<div class="object-box">
<div class="object-images">
{% for collection in site.collections %}
{% if collection.label == 'objects' %}
<ul class="images">
{% for file in collection.files %}
{% assign page_folder = page.path | split:"/" %}
{% assign file_folder = file.path | split:"/" %}
{% if page_folder[1] == file_folder[1] %}
{% assign source = file.path | remove_first:"_" %}
{% assign name = source | split:"/" | last %}
{% if file.extname == ".jpg" or
file.extname == ".png" or
file.extname == ".gif" or
file.extname == ".JPG" or
file.extname == ".PNG" or
file.extname == ".GIF" %}
<li><img src="{{ relative }}/{{ source }}" alt="{{ name }}"/></li>
{% endif %}
{% endif%}
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</div>
<div class="object-data">
<div class="object-meta">
<ul>
{% if page.object_name %}<li><span class="label">Name:</span> {{ page.object_name }}</li>{% endif %}
{% if page.designer %}<li><span class="label">Designer(s):</span> {% for designer in page.designer %}{{ designer }}{% if forloop.last%}{% else %}, {% endif %}{% endfor %}</li>{% endif %}
{% if page.builder %}<li><span class="label">Builder(s):</span> {% for builder in page.builder %}{{ builder }}{% if forloop.last%}{% else %}, {% endif %}{% endfor %}</li>{% endif %}
{% if page.category %}<li><span class="label">Category:</span> {{ page.category }}</li>{% endif %}
{% if page.tags %}<li><span class="label">Tags:</span> {% for tag in page.tags %}{{ tag }}{% if forloop.last%}{% else %}, {% endif %}{% endfor %}</li>{% endif %}
{% if page.creation_date %}<li><span class="label">Created:</span> {{ page.creation_date | date: "%B %Y" }}</li>{% endif %}
{% if page.contributors %}<li><span class="label">Contributors:</span> {{ page.contributors }}</li>{% endif %}
{% if page.derived_from %}
<li>
<span class="label">Derived from:</span>
{% for original in page.derived_from %}
{% assign derived = null %}
{% for obj in site.objects %}
{% if obj.object_name == original %}
{% assign derived = obj %}
{% endif%}
{% endfor %}
{% if derived != null %}<a href="{{ relative }}{{ derived.url | remove_first:"_" }}">{{ original }}</a>{% else %}{{ original }}{% endif %}{% if forloop.last %}{% else %}, {% endif %}
{% endfor %}
</li>
{% endif %}
{% if page.realisation_place %}<li><span class="label">Location:</span> {{ page.realisation_place }}</li>{% endif %}
{% if page.required_hardware %}<li><span class="label">Required hardware:</span> {% for hw in page.required_hardware %}{{ hw }}{% if forloop.last%}{% else %}, {% endif %}{% endfor %}</li>{% endif %}
{% if page.license %}<li><span class="label">License:</span> {{ page.license }}</li>{% endif %}
{% if page.client %}<li><span class="label">Client:</span> {{ page.client }}</li>{% endif %}
</ul>
</div>
<div class="object-content">
{{ content }}
</div>
<div class="object-download">
{% assign folder_name = page.url | split:"/" %}
<a href="{{ folder_name[2] }}.zip">Download</a>
</div>
<div class="object-files">
<p>List of files in the .zip folder available for download.</p>
{% for collection in site.collections %}
{% if collection.label == 'objects' %}
<ul class="files">
{% for file in collection.files %}
{% assign page_folder = page.path | split:"/" %}
{% assign file_folder = file.path | split:"/" %}
{% if page_folder[1] == file_folder[2] %}
{% assign source = file.path | remove_first:"_" %}
{% assign name = source | split:"/" | last %}
<li>
{% for item in file_folder offset:3 %}{{ item }}{% if forloop.last %}{% else %}/{% endif %}{% endfor%}
</li>
{% endif%}
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
{% include footer.html %}
</body>
</html>