-
Notifications
You must be signed in to change notification settings - Fork 0
/
posts.html
60 lines (54 loc) · 2.01 KB
/
posts.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
---
layout: page
title: Blog
---
{% include setup %}
<!-- main content -->
<div style="float: left; width: 75%;">
<div class="header1">Recent Posts</div>
<div style="height: 20px"></div> <!-- spacer -->
{% for post in site.posts limit:4 %}
<div style="padding-bottom: 30px">
<div style="padding-bottom: 10px"><span class="header2"><a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></span> - <span>{{ post.date | date_to_string }}</span></div>
<div style="padding: 0 30px 0 30px">
<p>{{ post.content | strip_html | truncatewords:150}}</p>
<p><a href="{{ post.url }}">Read more...</a></p>
</div>
</div>
{% endfor %}
</div>
<!-- sidebar -->
<div style="background: #a8a8a8; width: 25%; float: right; height: 100%;">
<div class="header1">All Posts</div>
<ul>
{% for post in site.posts %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%B" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% capture next_month %}{{ post.previous.date | date: "%B" }}{% endcapture %}
{% if forloop.first %}
<div class="header2">{{this_year}}</div>
<div class="header3">{{this_month}}</div>
<ul>
{% endif %}
<li><span>{{ post.date | date: "%B %e, %Y" }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% if forloop.last %}
</ul>
{% else %}
{% if this_year != next_year %}
</ul>
<div class="header2">{{next_year}}</div>
<div class="header3">{{next_month}}</div>
<ul>
{% else %}
{% if this_month != next_month %}
</ul>
<div class="header3">{{next_month}}</div>
<ul>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</ul>
</div>
<div class="clearfix"></div>