-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
91 lines (84 loc) · 3.91 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
layout: default
---
<div class="home">
{% if site.announcement %}
<div class="row">
<div class="large-12 columns">
<div class="callout warning" data-closable="hinge-out-from-top">
{{ site.announcement }}
<button class="close-button" aria-label="Dismiss alert" type="button" data-close>
<span aria-hidden="true">×</span>
</button>
</div>
</div>
</div>
{% endif %}
<div class="row">
<div class="large-8 columns" id="blog-posts">
{% for post in paginator.posts %}
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
{{ post.excerpt }}
{% capture content_words %}
{{ post.content | number_of_words }}
{% endcapture %}
{% capture excerpt_words %}
{{ post.excerpt | number_of_words }}
{% endcapture %}
{% if excerpt_words != content_words %}
<p><a href="{{ post.url }}">Read More...</a></p>
{% endif %}
<hr />
{% endfor %}
</div>
{% include sidebar.html %}
</div>
</div>
{% if paginator.total_pages > 1 %}
{% assign ellipsed = false %}
<div class="row">
<div class="large-12 columns">
<ul class="pagination text-center" role="navigation" aria-label="Pagination">
<li class="pagination-previous {% unless paginator.previous_page %} disabled{% endunless %}">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">
{% endif %}
Previous
{% if paginator.previous_page %}
</a>
{% endif %}
</li>
{% for page in (1..paginator.total_pages) %}
{% assign pages_minus_three = paginator.total_pages | minus : 3 %}
{% if page > 3 and page < pages_minus_three %}
{% assign page_plus_three = paginator.page | plus : 3 %}
{% assign page_minus_three = paginator.page | minus : 3 %}
{% if page < page_minus_three or page > page_plus_three %}
{% unless ellipsed %}
<li class="ellipsis"></li>
{% assign ellipsed = true %}
{% endunless %}
{% continue %}
{% endif %}
{% endif %}
{% assign ellipsed = false %}
{% if page == paginator.page %}
<li class="current"><span class="show-for-sr">You're on page</span> {{ page }}</li>
{% elsif page == 1 %}
<li><a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" aria-label="Page {{ page }}">{{ page }}</a></li>
{% else %}
<li><a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}" aria-label="Page {{ page }}">{{ page }}</a></li>
{% endif %}
{% endfor %}
<li class="pagination-next {% unless paginator.next_page %} disabled{% endunless %}">
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">
{% endif %}
Next
{% if paginator.next_page %}
</a>
{% endif %}
</ul>
</div>
</div>
{% endif %}