-
Notifications
You must be signed in to change notification settings - Fork 3
/
posts_future.html
64 lines (49 loc) · 1.69 KB
/
posts_future.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
---
layout: default
title: Posts
---
<div class="container">
<div class="inner-container posts">
<div class="switch">
<h3 id="chronological" class="default-on" onclick="selected(chronological)">Chronological</h3>
<h2>|</h2>
<h3 id="categories" onclick="selected(categories)">Categories</h3>
</div>
{% if switcher == "categories" %}
{% capture site_tags %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign tag_words = site_tags | split:',' | sort %}
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
{% capture this_word %}{{ tag_words[item] }}{% endcapture %}
<h4>{{ this_word }}</h4>
{% for post in site.tags[this_word] %}{% if post.title != null %}
{% include post.html%}
{% endif %}{% endfor %}
{% endunless %}{% endfor %}
{% else %}
{% assign monthSetter = "foo" %}
{% for post in site.posts%}
{% if monthSetter != post.month %}
{% assign monthSetter = post.month %}
<h4>{{monthSetter}} {{ post.date | date: "%Y" }}</h4>
{% endif %}
{% include post.html %}
{% endfor %}
{% endif %}
<script>
function selected(elmnt) {
if(elmnt == chronological)
{elmnt.style.fontWeight = 400;
categories.style.fontWeight = 300;
{% assign switcher = "chronological" %}
}
else if(elmnt == categories)
{elmnt.style.fontWeight = 400;
chronological.style.fontWeight = 300;
{% assign switcher = "categories" %}
}
window.location.reload();
}
</script>
</div>
</div>
<br>