-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
62 lines (57 loc) · 2.36 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
---
layout: default
---
<ul id="post-summary">
{%- for post in paginator.posts -%}
{%- assign thumbnail = post.content | split: "<img" | slice: 1 | first | split: '/>' | first -%}
<li class="post-summary-item">
<a href="{{- post.url -}}">
{%- if thumbnail -%}
<div class="post-summary-item-thumbnail">
<img {{ thumbnail }}/>
</div>
{%- endif -%}
<div class="post-summaries-item-body">
<h2 class="post-summaries-item-title">{{- post.title -}}</h2>
<p class="post-summaries-item-content">
{{- post.content | markdownify | strip_html | truncate: 200 -}}
</p>
<div class="post-summaries-item-metadata">
{%- include octicons/calendar.html -%}
<span>{{- post.date | date: "%b %e, %Y" -}}</span>
{%- if post.categories.size > 0 -%}
{%- assign category = site.category | where: 'slug', post.categories.first | first -%}
{%- include octicons/file-directory.html -%}
<span>{{- category.title -}}</span>
{%- if post.categories.size > 1 -%}
{%- assign subcategory = site.category | where: 'slug', post.categories.last | first -%}
<span> / {{- subcategory.title -}}</span>
{%- endif -%}
{%- endif -%}
</div>
</div>
</a>
</li>
{%- endfor -%}
</ul>
<div id="paginate">
{%- assign s = paginator.page | minus: 1 | divided_by: 8 | plus: 1 -%}
{%- assign e = paginator.page | minus: 1 | divided_by: 8 | plus: 8 | at_most: paginator.total_pages -%}
{%- if s > 1 -%}
<a href="/{{- s | minus: 1 -}}">
{%- include octicons/arrow-left.html -%}
</a>
{%- endif -%}
{%- for page_num in (s..e) -%}
{%- if page_num == paginator.page -%}
<span class="active">{{- page_num -}}</span>
{%- else -%}
<a href="/{%- if page_num > 1 -%}{{- page_num -}}{%- endif -%}">{{- page_num -}}</a>
{%- endif -%}
{%- endfor -%}
{%- if e < paginator.total_pages -%}
<a href="/{{- e | plus: 1 -}}">
{%- include octicons/arrow-right.html -%}
</a>
{%- endif -%}
</div>