Skip to content

Commit 733a42e

Browse files
committed
Copied changes from hmpl/blog
1 parent dbc8295 commit 733a42e

File tree

5 files changed

+115
-6
lines changed

5 files changed

+115
-6
lines changed

Gemfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
source "https://rubygems.org"
22
gem "jekyll", "~> 4.3.3"
33
gem "minima", "~> 2.5.2"
4+
gem "csv"
5+
gem "logger"
6+
gem "base64"
47
group :jekyll_plugins do
58
gem "jekyll-feed", "~> 0.12"
69
gem "jekyll-seo-tag"
710
gem "jekyll-sitemap"
11+
gem "jekyll-paginate"
812
end
913
platforms :mingw, :x64_mingw, :mswin, :jruby do
1014
gem "tzinfo", ">= 1", "< 3"
1115
gem "tzinfo-data"
1216
end
13-
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
17+
18+
# Windows Directory Monitor - commented out due to Ruby 3.4 compatibility issues
19+
# gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
20+
1421
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ plugins:
4242
- jekyll-feed
4343
- jekyll-seo-tag
4444
- jekyll-sitemap
45+
- jekyll-paginate
46+
47+
# Pagination Configuration
48+
paginate: 5
49+
paginate_path: "/page:num/"
4550

4651
# Feed Configuration
4752
feed:

_layouts/home.html

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,32 @@ <h3>
8080
<div class="pager">
8181
<ul class="pagination">
8282
{%- if paginator.previous_page %}
83-
<li><a href="{{ paginator.previous_page_path | relative_url }}" class="previous-page">{{ paginator.previous_page }}</a></li>
83+
<li><a href="{{ paginator.previous_page_path | relative_url }}" class="previous-page">← Previous</a></li>
8484
{%- else %}
85-
<li><div class="pager-edge"></div></li>
85+
<li><span class="pager-edge disabled">← Previous</span></li>
8686
{%- endif %}
87-
<li><div class="current-page">{{ paginator.page }}</div></li>
87+
88+
{%- for page in (1..paginator.total_pages) %}
89+
{%- if page == paginator.page %}
90+
<li><span class="current-page">{{ page }}</span></li>
91+
{%- elsif page == 1 %}
92+
<li><a href="{{ '/' | relative_url }}" class="page-link">{{ page }}</a></li>
93+
{%- else %}
94+
<li><a href="{{ site.paginate_path | replace: ':num', page | relative_url }}" class="page-link">{{ page }}</a></li>
95+
{%- endif %}
96+
{%- endfor %}
97+
8898
{%- if paginator.next_page %}
89-
<li><a href="{{ paginator.next_page_path | relative_url }}" class="next-page">{{ paginator.next_page }}</a></li>
99+
<li><a href="{{ paginator.next_page_path | relative_url }}" class="next-page">Next →</a></li>
90100
{%- else %}
91-
<li><div class="pager-edge"></div></li>
101+
<li><span class="pager-edge disabled">Next →</span></li>
92102
{%- endif %}
93103
</ul>
104+
105+
<div class="pagination-info">
106+
<p>Page {{ paginator.page }} of {{ paginator.total_pages }}
107+
({{ paginator.posts.size }} of {{ paginator.total_posts }} posts)</p>
108+
</div>
94109
</div>
95110
{%- endif %}
96111

assets/main.scss

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,62 @@ body {
510510
content: "";
511511
}
512512

513+
/* Pagination Styles */
514+
.pager {
515+
margin: 2rem 0;
516+
text-align: center;
517+
}
518+
519+
.pagination {
520+
list-style: none;
521+
display: inline-flex;
522+
align-items: center;
523+
justify-content: center;
524+
gap: 0.5rem;
525+
margin: 0;
526+
padding: 0;
527+
}
528+
529+
.pagination li {
530+
margin: 0;
531+
}
532+
533+
.pagination a,
534+
.pagination span {
535+
display: inline-block;
536+
padding: 0.5rem 1rem;
537+
text-decoration: none;
538+
border: 1px solid #ddd;
539+
border-radius: 4px;
540+
transition: background-color 0.2s;
541+
}
542+
543+
.pagination a:hover {
544+
background-color: #f5f5f5;
545+
}
546+
547+
.pagination .current-page {
548+
background-color: #0366d6;
549+
color: white;
550+
border-color: #0366d6;
551+
}
552+
553+
.pagination .disabled {
554+
color: #999;
555+
cursor: not-allowed;
556+
background-color: #f8f9fa;
557+
}
558+
559+
.pagination-info {
560+
margin-top: 1rem;
561+
color: #666;
562+
font-size: 0.9rem;
563+
}
564+
565+
.pagination-info p {
566+
margin: 0;
567+
}
568+
513569
// Mobile responsive
514570
@media (max-width: 600px) {
515571
.wrapper {
@@ -573,4 +629,16 @@ body {
573629
.social-media-list .username {
574630
display: inline;
575631
}
632+
633+
/* Responsive pagination */
634+
.pagination {
635+
flex-wrap: wrap;
636+
gap: 0.25rem;
637+
}
638+
639+
.pagination a,
640+
.pagination span {
641+
padding: 0.4rem 0.8rem;
642+
font-size: 0.9rem;
643+
}
576644
}

index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: home
3+
title: "HMPL Blog - JavaScript Templating Tutorials & Guides"
4+
description: "Learn HMPL, a server-oriented customizable templating solution for JavaScript. Tutorials, guides, examples, and best practices for modern web development."
5+
keywords: "HMPL, JavaScript, templating, tutorials, guides, web development, server-side rendering, SSR, frontend, backend"
6+
seo:
7+
type: "Blog"
8+
---
9+
10+
# Welcome to HMPL Blog
11+
12+
Discover the power of server-oriented customizable templating for JavaScript applications. Our blog features comprehensive tutorials, practical guides, and real-world examples to help you master HMPL.
13+
14+
## Latest Posts

0 commit comments

Comments
 (0)