Skip to content

Commit 1db5170

Browse files
google-labs-jules[bot]vjdhama
authored andcommitted
feat: Implement numbered pagination for blog
This commit introduces a numbered pagination system for the blog, displaying 10 posts per page. - Implements a numbered pagination partial with corresponding styles. - Modifies the blog list template to use the new pagination partial. - Updates `config.toml` to use the correct `pagerSize` key for pagination. - Refactors pagination styles into a separate `_pagination.scss` partial for better organization and scopes them to a `.blog-pagination` class.
1 parent 3f2b9db commit 1db5170

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.blog-pagination .pagination {
2+
display: flex;
3+
justify-content: center;
4+
margin-top: 2rem;
5+
.page-item {
6+
margin: 0 0.25rem;
7+
&.active .page-link {
8+
background-color: $primary;
9+
color: $white;
10+
border-color: $primary;
11+
}
12+
.page-link {
13+
border-radius: 0.25rem;
14+
}
15+
}
16+
}

assets/scss/style.scss

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ $sub-footer-text-color: $white;
5757
@import 'components/social';
5858
@import 'components/blog-carousel';
5959
@import 'components/testimonials';
60+
@import 'components/pagination';
6061

6162
// Pages
6263
@import 'pages/home';
@@ -72,20 +73,3 @@ body {
7273
line-height: 1.3;
7374
}
7475
}
75-
76-
.pagination {
77-
display: flex;
78-
justify-content: center;
79-
margin-top: 2rem;
80-
.page-item {
81-
margin: 0 0.25rem;
82-
&.active .page-link {
83-
background-color: $primary;
84-
color: $white;
85-
border-color: $primary;
86-
}
87-
.page-link {
88-
border-radius: 0.25rem;
89-
}
90-
}
91-
}

layouts/blog/list.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
</div>
1919
{{ end }}
2020
</div>
21-
{{ partial "pagination.html" . }}
21+
<div class="blog-pagination">
22+
{{ partial "pagination.html" . }}
23+
</div>
2224
</div>
2325
{{ end }}

0 commit comments

Comments
 (0)