-
Notifications
You must be signed in to change notification settings - Fork 1
/
posts.html
101 lines (86 loc) · 3.43 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
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
98
99
100
101
---
title: Posts
layout: default
nav: posts
redirect_from:
- /writing
pagination:
enabled: true
---
<div class="animate-wrap"> <!-- closes in footer -->
<div class="page-wrap">
<section class="unit page-top">
<div class="container">
<div class="row">
<div class="twelve columns">
<div class="wrap-page">
<div class="row">
<div class="nine columns">
<div class="posts-wrap">
{% for post in paginator.posts %}
{% capture url_to_use %}{{ post.url }}{% endcapture %}
{% if post.external_url %}
{% capture url_to_use %}{{ post.external_url }}{% endcapture %}
{% endif %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% if forloop.first %}
<h6 class="muted">{{this_year}}</h6>
{% endif %}
<div class="post-row row">
<div class="eight columns">
<h4 class="article-title">
<a href="{{ url_to_use }}"
{% if post.external_url %} target="_blank" class="external-link"{% endif %}
>
{{ post.title }}
</a>
</h4>
<p class="date">{{ post.date | date_to_string }}</p>
<div class="excerpt">{{ post.excerpt }}</div>
</div>
{% if post.image %}
<div class="four columns post-img_preview">
<a href="{{ url_to_use }}"
{% if post.external_url %} target="_blank" class="external-link"{% endif %}
>
<img src="{{ site.baseurl }}/img/post/{{ post.image }}">
</a>
</div>
{% endif %}
</div>
{% if forloop.last %}
{% else %}
{% if this_year != next_year %}
<br>
<h6 class="muted">{{next_year}}</h6>
{% endif %}
{% endif %}
{% endfor %}
<!-- Pagination -->
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}" class="previous">
« Previous
</a>
{% else %}
<span class="previous disabled">« Previous</span>
{% endif %}
<span class="page_number">
{{ paginator.page }} of {{ paginator.total_pages }}
</span>
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}" class="next">Next »</a>
{% else %}
<span class="next disabled">Next »</span>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>