-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·94 lines (78 loc) · 2.65 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
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
---
title: short circut
layout: default
---
<div class="info">
<div class="key">
<ul>
<li>Key:</li>
<li><i class="fa-bullhorn" aria-hidden="true"></i> talk</li>
<li><i class="fa fa-tasks" aria-hidden="true"></i> tutorial</li>
<!-- <li><i class="fa fa-book" aria-hidden="true"></i> </li> -->
</ul></div>
<div class="">
</div>
<div class="about-link"><a href="{{ site.github.url }}/about">About </a></div>
<div class="about-link"><a href="https://github.com/fjordsf">Github </a></div>
<div class="about-link"><a href="http://devices.fjordsf.com/">Device Locker</a></div>
</div>
<div class="blog-list-container" id="all-container">
{% for post in site.posts %}
<a href="{{ post.link }}">
<div class="reading">
<div class="icon">{{ post.type }}</div>
<div class="title">{{ post.title }}</div>
<div class="author">{{ post.author }}</div>
<div class="year">{{ post.year }}</div>
</div>
</a>
{% endfor %}
</div>
{% for tag in site.tags %}
{% assign c = tag | first %}
{% assign posts = tag | last %}
<div class="blog-list-container hidden" id="{{ c }}-container">
{% for post in posts %}
{% if post.tags contains c %}
<a href="{{ post.link }}">
<div class="reading">
<div class="icon">{{ post.type }}</div>
<div class="title">{{ post.title }}</div>
<div class="author">{{ post.author }}</div>
<div class="year">{{ post.year }}</div>
</div>
</a>
{% endif %}
{% endfor %}
</div>
{% endfor %}
<script>
function filter(tag) {
setActivetag(tag);
showContainer(tag);
}
function setActivetag(tag) {
// loop through all items and remove active class
var items = document.getElementsByClassName('blog-tags-item');
for(var i=0; i < items.length; i++) {
items[i].setAttribute('class', 'blog-tags-item');
}
// set the selected tag's item to active
var item = document.getElementById(tag + '-item');
if(item) {
item.setAttribute('class', 'blog-tags-item active');
}
}
function showContainer(tag) {
// loop through all lists and hide them
var lists = document.getElementsByClassName('blog-list-container');
for(var i=0; i < lists.length; i++) {
lists[i].setAttribute('class', 'blog-list-container hidden');
}
// remove the hidden class from the list corresponding to the selected tag
var list = document.getElementById(tag + '-container');
if(list) {
list.setAttribute('class', 'blog-list-container');
}
}
</script>