-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgallery.html
executable file
·53 lines (41 loc) · 1.34 KB
/
gallery.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
---
layout: default
title: CDAT Gallery
scripts: [/js/gallery_filter.js]
---
<h1>Gallery <small><a href="/example_index.html">(Index)</a></small></h1>
<div class="alert alert-success">Feeling lost? Check out our <a href="/getting_started.html">Getting Started</a> guide.</div>
{% assign ex_tags = site.examples | map: "tags"%}
{% assign tags = "" %}
{% for tarr in ex_tags %}
{% assign splittags = tags | split: "|" %}
{% for tag in tarr %}
{% assign tags = tags | append: tag | append: "|" %}
{% endfor %}
{% endfor %}
{% assign tag_array = tags | split: "|" %}
{% assign filtered_tags = "" %}
{% for tag in tag_array %}
{% assign ft_arr = filtered_tags | split: "|" %}
{% unless ft_arr contains tag %}
{% assign filtered_tags = filtered_tags | append: tag | append: "|" %}
{% endunless %}
{% endfor %}
{% assign tags = filtered_tags | split:"|" | sort%}
<h4>Filters</h4>
<ul class="filters">
{% for tag in tags %}
<li><a href="#{{tag}}" class="filter_link">{{tag}}</a></li>
{% endfor %}
</ul>
{% assign sorted_examples = site.examples | sort: "priority" %}
{% for example in sorted_examples %}
<div class="example" data-tags="{{example.tags | join:','}}">
<a href="{{ example.url }}">
<div class="img-wrapper">
<img src="{{ example.thumb }}" />
</div>
<p>{{ example.title }}</p>
</a>
</div>
{% endfor %}