This repository has been archived by the owner on Jun 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
executable file
·69 lines (63 loc) · 2.47 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
---
layout: default
---
{% for post in paginator.posts %}
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<section class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting" itemref="owner">
<div class="page-header">
<h2><a href="{{ site.baseurl }}{{ post.url }}" itemprop="url" content="{{ site.url }}{{ site.baseurl }}{{ post.url }}"><i class="fa fa-puzzle-piece"></i> <span itemprop="name">{{ post.title }}</span></a></h2>
</div>
<p class="lead" itemprop="description">{{ post.content | strip_html | truncate: 150 }}</p>
</section>
</div>
</div>
{% endfor %}
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
{% assign pagination_column_nums = 3 %}
{% assign pagination_start_page = 1 %}
{% assign pagination_end_page = pagination_column_nums %}
{% if paginator.page > pagination_column_nums %}
{% assign pagination_start_page = paginator.page | minus: pagination_column_nums | plus:1 %}
{% assign pagination_end_page = paginator.page %}
{% elsif pagination_column_nums > paginator.total_pages %}
{% assign pagination_end_page = paginator.total_pages %}
{% endif %}
<div class="text-center">
<ul class="pagination">
{% if pagination_start_page == 1 %}
<li class="disabled"><span>«</span></li>
{% else %}
{% assign pagination_previous_page = pagination_start_page | minus:1 %}
<li>
{% if pagination_previous_page == 1 %}
<a href="{{ site.baseurl }}/">
{% else %}
<a href="{{ site.baseurl }}/page{{ pagination_previous_page }}/">
{% endif %}
«</a>
</li>
{% endif %}
{% for i in (pagination_start_page..pagination_end_page) %}
<li{% if i == paginator.page %} class="active"{% endif %}>
{% if i == 1 %}
<a href="{{ site.baseurl }}/">
{% else %}
<a href="{{ site.baseurl }}/page{{ i }}/">
{% endif %}
{{ i }}</a>
</li>
{% endfor %}
{% if pagination_end_page == paginator.total_pages %}
<li class="disabled"><span>»</span></li>
{% else %}
{% assign pagination_next_page = pagination_end_page | plus:1 %}
<li>
<a href="{{ site.baseurl }}/page{{ pagination_next_page }}/">»</a>
</li>
{% endif %}
</ul>
</div>
</div>
</div>