From a7cd871b183679a8fe5287155283d23bff9d5d56 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 1 Jul 2025 01:10:02 +0900 Subject: feat(blog/nuldoc): update page navigation --- services/blog/nuldoc-src/components/Pagination.tsx | 117 ++++++++++++--------- services/blog/nuldoc-src/jsx/types.d.ts | 1 + services/blog/public/404.html | 2 +- services/blog/public/about/index.html | 2 +- services/blog/public/index.html | 2 +- services/blog/public/posts/2/index.html | 12 ++- .../posts/2021-03-05/my-first-post/index.html | 2 +- .../posts/2021-03-30/phperkaigi-2021/index.html | 2 +- .../index.html | 2 +- .../python-unbound-local-error/index.html | 2 +- .../ruby-detect-running-implementation/index.html | 2 +- .../ruby-then-keyword-and-case-in/index.html | 2 +- .../rust-where-are-primitive-types-from/index.html | 2 +- .../index.html | 2 +- .../vim-swap-order-of-selected-lines/index.html | 2 +- .../2022-04-09/phperkaigi-2022-tokens/index.html | 2 +- .../index.html | 2 +- .../posts/2022-05-01/phperkaigi-2022/index.html | 2 +- .../php-conference-okinawa-code-golf/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../phperkaigi-2023-unused-token-quiz-1/index.html | 2 +- .../setup-server-for-this-site/index.html | 2 +- .../phperkaigi-2023-unused-token-quiz-2/index.html | 2 +- .../phperkaigi-2023-unused-token-quiz-3/index.html | 2 +- .../rewrite-this-blog-generator/index.html | 2 +- .../index.html | 2 +- .../2023-04-04/phperkaigi-2023-report/index.html | 2 +- .../2023-06-25/phpconfuk-2023-report/index.html | 2 +- .../compile-php-runtime-to-wasm/index.html | 2 +- .../index.html | 2 +- .../public/posts/2023-12-03/isucon-13/index.html | 2 +- .../posts/2023-12-31/2023-reflections/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../2024-02-10/yapcjapan-2024-report/index.html | 2 +- .../2024-02-22/phpkansai-2024-report/index.html | 2 +- .../2024-03-17/phperkaigi-2024-report/index.html | 2 +- .../posts/2024-03-20/my-bucket-list/index.html | 2 +- .../phpcon-odawara-2024-report/index.html | 2 +- .../pipefail-option-in-gitlab-ci-cd/index.html | 2 +- .../index.html | 2 +- .../2024-05-11/phpconkagawa-2024-report/index.html | 2 +- .../2024-06-19/scalamatsuri-2024-report/index.html | 2 +- .../reparojson-fix-only-json-formatter/index.html | 2 +- .../index.html | 2 +- .../posts/2024-09-28/mncore-challenge-1/index.html | 2 +- .../posts/2024-12-04/cohackpp-report/index.html | 2 +- .../posts/2024-12-33/2024-reflections/index.html | 2 +- .../phperkaigi-2023-tokens-q1/index.html | 2 +- .../index.html | 2 +- .../phpcon-nagoya-2025-report/index.html | 2 +- .../index.html | 2 +- .../http-1-1-send-multiple-same-headers/index.html | 2 +- .../trick-2025-most-ruby-on-ruby-award/index.html | 2 +- .../index.html | 2 +- .../make-tiny-self-hosted-c-compiler/index.html | 2 +- .../public/posts/2025-06-14/baba-is-you/index.html | 2 +- services/blog/public/posts/3/index.html | 28 +++-- services/blog/public/posts/4/index.html | 28 +++-- services/blog/public/posts/5/index.html | 12 ++- services/blog/public/posts/6/index.html | 12 ++- services/blog/public/posts/index.html | 12 ++- .../2023-01-18/phpstudy-tokyo-148/index.html | 2 +- .../2023-02-15/phpstudy-tokyo-149/index.html | 2 +- .../2023-03-15/phpstudy-tokyo-150/index.html | 2 +- .../slides/2023-03-24/phperkaigi-2023/index.html | 2 +- .../2023-03-25/phperkaigi-2023-tokens/index.html | 2 +- .../2023-04-12/phpstudy-tokyo-151/index.html | 2 +- .../2023-06-21/phpstudy-tokyo-153/index.html | 2 +- .../2023-06-23/phpconfuk-2023-eve/index.html | 2 +- .../2023-07-26/phpstudy-tokyo-154/index.html | 2 +- .../2023-08-24/phpstudy-tokyo-155/index.html | 2 +- .../2023-10-25/phpstudy-tokyo-157/index.html | 2 +- .../2024-01-24/phpstudy-tokyo-160/index.html | 2 +- .../slides/2024-03-08/phperkaigi-2024/index.html | 2 +- .../public/slides/2024-03-15/ya8-2024/index.html | 2 +- .../2024-04-13/phpcon-odawara-2024/index.html | 2 +- .../2024-04-25/phpstudy-tokyo-163/index.html | 2 +- .../2024-07-18/phpstudy-tokyo-166/index.html | 2 +- .../2024-10-30/phpstudy-tokyo-169/index.html | 2 +- .../public/slides/2024-11-30/cohackpp/index.html | 2 +- .../2025-02-22/phpcon-nagoya-2025/index.html | 2 +- .../slides/2025-03-23/phperkaigi-2025/index.html | 2 +- .../2025-04-12/phpcon-odawara-2025/index.html | 2 +- services/blog/public/slides/index.html | 2 +- services/blog/public/style.css | 9 +- services/blog/public/tags/c/index.html | 2 +- services/blog/public/tags/ci-cd/index.html | 2 +- services/blog/public/tags/cohackpp/index.html | 2 +- services/blog/public/tags/composer/index.html | 2 +- services/blog/public/tags/conference/index.html | 2 +- services/blog/public/tags/cpp/index.html | 2 +- services/blog/public/tags/cpp17/index.html | 2 +- services/blog/public/tags/game/index.html | 2 +- services/blog/public/tags/gitlab/index.html | 2 +- services/blog/public/tags/go/index.html | 2 +- services/blog/public/tags/http/index.html | 2 +- services/blog/public/tags/index.html | 2 +- services/blog/public/tags/isucon/index.html | 2 +- services/blog/public/tags/macos/index.html | 2 +- .../blog/public/tags/mncore-challenge/index.html | 2 +- services/blog/public/tags/neovim/index.html | 2 +- services/blog/public/tags/note-to-self/index.html | 2 +- services/blog/public/tags/ouj/index.html | 2 +- services/blog/public/tags/perl/index.html | 2 +- services/blog/public/tags/php/index.html | 2 +- services/blog/public/tags/phpcon-nagoya/index.html | 2 +- .../blog/public/tags/phpcon-odawara/index.html | 2 +- services/blog/public/tags/phpconfuk/index.html | 2 +- services/blog/public/tags/phpconkagawa/index.html | 2 +- services/blog/public/tags/phpconokinawa/index.html | 2 +- services/blog/public/tags/phperkaigi/index.html | 2 +- services/blog/public/tags/phpkansai/index.html | 2 +- .../blog/public/tags/phpstudy-tokyo/index.html | 2 +- services/blog/public/tags/piet/index.html | 2 +- services/blog/public/tags/python/index.html | 2 +- services/blog/public/tags/python3/index.html | 2 +- services/blog/public/tags/ruby/index.html | 2 +- services/blog/public/tags/ruby3/index.html | 2 +- services/blog/public/tags/rubykaigi/index.html | 2 +- services/blog/public/tags/rust/index.html | 2 +- services/blog/public/tags/scala/index.html | 2 +- services/blog/public/tags/scalamatsuri/index.html | 2 +- services/blog/public/tags/trick/index.html | 2 +- services/blog/public/tags/vim/index.html | 2 +- services/blog/public/tags/wasm/index.html | 2 +- services/blog/public/tags/wireguard/index.html | 2 +- services/blog/public/tags/ya8/index.html | 2 +- services/blog/public/tags/yaml/index.html | 2 +- services/blog/public/tags/yapc/index.html | 2 +- services/blog/public/tags/zsh/index.html | 2 +- services/blog/static/style.css | 9 +- 133 files changed, 277 insertions(+), 209 deletions(-) diff --git a/services/blog/nuldoc-src/components/Pagination.tsx b/services/blog/nuldoc-src/components/Pagination.tsx index ab13e361..84752c5e 100644 --- a/services/blog/nuldoc-src/components/Pagination.tsx +++ b/services/blog/nuldoc-src/components/Pagination.tsx @@ -11,68 +11,44 @@ export default function Pagination( return
; } - const firstPage = 1; - const lastPage = totalPages; - const prevPage = currentPage > 1 ? currentPage - 1 : null; - const nextPage = currentPage < totalPages ? currentPage + 1 : null; - - const firstHref = pageUrlAt(basePath, firstPage); - const lastHref = pageUrlAt(basePath, lastPage); - const prevHref = prevPage ? pageUrlAt(basePath, prevPage) : null; - const nextHref = nextPage ? pageUrlAt(basePath, nextPage) : null; + const pages = generatePageNumbers(currentPage, totalPages); return (