diff --git a/Gemfile b/Gemfile index c392852..3237b38 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ group :jekyll_plugins do gem "github-pages" gem "jekyll-remote-theme" gem "jekyll-feed" + gem "jekyll-paginate" end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index aa1d472..65c5ae8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -309,6 +309,7 @@ DEPENDENCIES github-pages jekyll jekyll-feed + jekyll-paginate jekyll-remote-theme jemoji tzinfo-data diff --git a/_config.yml b/_config.yml index a759cbc..29e04c4 100644 --- a/_config.yml +++ b/_config.yml @@ -60,6 +60,7 @@ plugins: - jemoji - jekyll-feed - jekyll-sitemap + - jekyll-paginate # - jekyll-seo-tag # - jekyll-redirect-from # - jekyll-remote-theme @@ -111,3 +112,6 @@ defaults: # Set to `true` to show excerpts on the homepage. # show_excerpts: true + +paginate: 5 +paginate_path: "/blog/page:num/" diff --git a/_includes/posts.html b/_includes/posts.html index 0227d1b..f05910b 100644 --- a/_includes/posts.html +++ b/_includes/posts.html @@ -30,21 +30,28 @@

{% if site.paginate %} -
-
- {%- endif %} -{%- endif -%} + {%- endif %} + +{%- endif -%} diff --git a/assets/css/bpd.css b/assets/css/bpd.css index b26d4e1..0f1c318 100644 --- a/assets/css/bpd.css +++ b/assets/css/bpd.css @@ -522,3 +522,38 @@ ul.speaking-list { max-width: 60%; } } + +.pagination { + display: flex; + gap: 10px; + justify-content: center; + align-items: center; +} + +.pagination a { + text-decoration: none; + padding: 5px 10px; + border: 1px solid #ddd; + border-radius: 4px; + color: #007acc; +} + +.pagination a:hover { + background-color: #007acc; + color: #fff; +} + +.pagination .current { + padding: 5px 10px; + border: 1px solid #007acc; + background-color: #007acc; + color: white; + border-radius: 4px; +} + +.pagination .disabled { + padding: 5px 10px; + border: 1px solid #ddd; + color: #aaa; + cursor: not-allowed; +} diff --git a/blog.md b/blog.md deleted file mode 100644 index 9caac8c..0000000 --- a/blog.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: default -lang: en -title: Blog -permalink: /blog/ -list_title: Posts ---- - -
- {%- include posts.html -%} -
diff --git a/blog/index.html b/blog/index.html new file mode 100644 index 0000000..7b6f5f1 --- /dev/null +++ b/blog/index.html @@ -0,0 +1,8 @@ +--- +layout: default +lang: en +title: Blog +list_title: Posts +--- + +
{%- include posts.html -%}
diff --git a/tests/test.py b/tests/test.py index 88bfcab..3c068dc 100644 --- a/tests/test.py +++ b/tests/test.py @@ -106,10 +106,7 @@ def test_mailto_bpdevs(page_url: tuple[Page, str]) -> None: @pytest.mark.parametrize( "url", - ( - "/", - "/blog", - ), + ("/blog",), ) def test_page_description_in_index_and_blog(page_url: tuple[Page, str], url: str): """Checks for the descriptions data in the blog posts. There should be some objects with the class `post-description`"""