-
Notifications
You must be signed in to change notification settings - Fork 1
/
posts.html
executable file
·89 lines (84 loc) · 2.7 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
---
layout: default
lang: pt-br
title: Posts
permalink: /posts/
pagination:
enabled: true
---
<div class="container-fluid bg-info text-light py-5">
<div class="container">
<h1>Posts</h1>
</div>
</div>
<div class="container">
{% for post in site.posts %}
<div class="py-4">
<h2>
<a href="{{ post.url | relative_url }}" class="text-dark link-clean">{{ post.title | escape }}</a>
</h2>
<p>
<time datetime="{{ post.date | date_to_xmlschema }}" class="text-secondary">
{% include date.html date=post.date %}
</time>
</p>
<p>
{{ post.content | strip_html | truncatewords:40 }}
</p>
<p>
<a class="btn btn-info" href="{{ post.url | relative_url }}" role="button">Leia mais »</a>
</p>
<hr />
</div>
{% endfor %}
{%- comment -%}
<!-- Pagination links -->
<nav aria-label="Page navigation example">
{% if paginator.total_pages > 1 %}
<ul class="pagination justify-content-center">
{% if paginator.previous_page %}
<li class="page-item">
<a class="page-link bg-light text-dark" href="{{ paginator.previous_page_path }}" aria-label="Previous">
<span aria-hidden="true">«</span>
<span class="sr-only">Previous</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<a class="page-link bg-light text-dark" href="#!" aria-label="Previous">
<span aria-hidden="true">«</span>
<span class="sr-only">Previous</span>
</a>
</li>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<li class="page-item active"><a class="page-link text-light bg-info" href="#!">{{ page }}</a></li>
{% elsif page == 1 %}
<li class="page-item"><a class="page-link bg-light text-dark" href="{{ '/posts/' }}">{{ page }}</a></li>
{% else %}
<li class="page-item"><a class="page-link bg-light text-dark"
href="{{ site.paginate_path | replace: ':num', page | prepend: 'posts' | relative_url }}">{{ page }}</a>
</li>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<li class="page-item">
<a class="page-link bg-light text-dark" href="{{ paginator.next_page_path }}" aria-label="Next">
<span aria-hidden="true">»</span>
<span class="sr-only">Next</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<a class="page-link bg-light text-dark" href="#!" aria-label="Next">
<span aria-hidden="true">»</span>
<span class="sr-only">Next</span>
</a>
</li>
{% endif %}
</ul>
{% endif %}
</nav>
{%- endcomment -%}
</div>