From 113e0c129aa22697fe058e7180bb598b3ad29df3 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Mon, 25 Dec 2023 21:37:38 -0700 Subject: [PATCH] Improve pagination styling. --- _config.yml | 2 +- _includes/post-paginator.html | 42 +++++++++++++++++++++++++---------- _layouts/home.html | 2 ++ _sass/_home.scss | 21 ++++++++++++++++++ 4 files changed, 54 insertions(+), 13 deletions(-) diff --git a/_config.yml b/_config.yml index 392cff9..cc5629f 100644 --- a/_config.yml +++ b/_config.yml @@ -32,7 +32,7 @@ plugins: pagination: enabled: true - per_page: 10 + per_page: 5 permalink: '/page/:num/' limit: 0 sort_field: 'date' diff --git a/_includes/post-paginator.html b/_includes/post-paginator.html index 88f28ef..c8a6f6e 100644 --- a/_includes/post-paginator.html +++ b/_includes/post-paginator.html @@ -1,14 +1,32 @@ {% if paginator.total_pages > 1 %} - + + {% endif %} diff --git a/_layouts/home.html b/_layouts/home.html index c44fefb..5deb677 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -2,6 +2,7 @@ layout: default --- +{% if paginator.page_path contains "index" %}

Most applications listed below are served from NixOS machines hosted on Digital Ocean. @@ -9,6 +10,7 @@ layout: default If interested in starting a similar hosting solution, consider getting a $200 credit using my referral link.

+{% endif %} {% for post in paginator.posts %}
diff --git a/_sass/_home.scss b/_sass/_home.scss index fd6d7e8..6ed3d78 100644 --- a/_sass/_home.scss +++ b/_sass/_home.scss @@ -10,3 +10,24 @@ max-height: 220px; } } + +ul.pagination { + list-style: none; + display: flex; + gap: 2rem; + padding: 0; + margin-bottom: 0; + justify-content: center; + + li.disabled { + opacity: 0.5; + + .page-link i { + cursor: not-allowed; + } + } + + .page-link i { + font-size: 1.75rem; + } +}