File tree 4 files changed +36
-8
lines changed
4 files changed +36
-8
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
layout: default
3
+ pagination:
4
+ enabled: true
3
5
---
4
6
5
7
< div class ="home ">
8
+ <!-- This is root index.html file, so no need to display title
6
9
{%- if page.title -%}
7
10
<h1 class="page-heading">{{ page.title }}</h1>
8
11
{%- endif -%}
12
+ -->
9
13
10
14
{{ content }}
11
15
12
16
{%- if site.posts.size > 0 -%}
13
17
< h2 class ="post-list-heading "> {{ page.list_title | default: "Posts" }}</ h2 >
14
18
< ul class ="post-list ">
15
- {%- for post in site .posts -%}
19
+ {%- for post in paginator .posts -%}
16
20
< li >
17
21
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
18
22
< span class ="post-meta "> {{ post.date | date: date_format }}</ span >
28
32
{%- endfor -%}
29
33
</ ul >
30
34
35
+ < div class ="pagination ">
36
+ {%- if paginator.previous_page %}
37
+ < a href ="{{ paginator.previous_page_path }} "> Previous</ a >
38
+ {%- endif %}
39
+ <!-- For pagination numbers if needed
40
+ {%- for page in (1..paginator.total_pages) -%}
41
+ {%- if page == paginator.page %}
42
+ <span class="page-number current">{{ page }}</span>
43
+ {%- else %}
44
+ <a href="{{ paginator.page_path | replace: ':num', page }}" class="page-number">{{ page }}</a>
45
+ {%- endif %}
46
+ {%- endfor -%}
47
+ -->
48
+
49
+ {%- if paginator.next_page %}
50
+ < a href ="{{ paginator.next_page_path }} "> Next</ a >
51
+ {%- endif %}
52
+ </ div >
31
53
{%- endif -%}
32
54
33
55
</ div >
Original file line number Diff line number Diff line change 6
6
7
7
.social-links {
8
8
display : flex;
9
- gap : 10 px ;
9
+ gap : 20 px ;
10
10
align-items : center;
11
11
}
12
12
27
27
.intro-text {
28
28
padding-top : 10px ;
29
29
}
30
+
31
+ .pagination {
32
+ display : flex;
33
+ gap : 10px ;
34
+ margin-top : 20px ;
35
+ }
Original file line number Diff line number Diff line change
1
+ ---
2
+ layout: home
3
+ title: "Home"
4
+ pagination:
5
+ enabled: true
6
+ ---
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments