From 35c0537439b9050f376d6724738d1a0c74cffa6b Mon Sep 17 00:00:00 2001 From: kennethcheng Date: Mon, 27 Apr 2026 15:34:20 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E5=BC=95=E5=85=A5=20pagefind=20?= =?UTF-8?q?=E5=B9=B6=E5=9C=A8=20build=20=E9=98=B6=E6=AE=B5=E6=8C=82?= =?UTF-8?q?=E8=BD=BD=E6=90=9C=E7=B4=A2=E7=B4=A2=E5=BC=95=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEV_LOG.md | 2 + package-lock.json | 106 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 5 ++- 3 files changed, 112 insertions(+), 1 deletion(-) diff --git a/DEV_LOG.md b/DEV_LOG.md index 87b1567..a5d1923 100644 --- a/DEV_LOG.md +++ b/DEV_LOG.md @@ -39,6 +39,8 @@ - **Task 24**: 为 TOC 目录追加局部 CSS,将默认滚动条重构为现代化的极细隐形滚动条(支持明暗模式双效)。 +- **Task 25**: 引入 Pagefind 依赖,并重构 build 工作流实现自动建立本地离线搜索索引。 + --- **🔄 当前状态**: 系统架构稳定,UI 交互流畅。所有功能模块已固化至 Git 版本控制。 **📝 下一步计划**: 等待分配新需求(如:全文搜索、SEO 优化等)。 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index da8c110..eed6207 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,9 @@ "remark-math": "^6.0.0", "tailwindcss": "^4.2.4" }, + "devDependencies": { + "pagefind": "^1.5.2" + }, "engines": { "node": ">=22.12.0" } @@ -1191,6 +1194,90 @@ "integrity": "sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==", "license": "MIT" }, + "node_modules/@pagefind/darwin-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/@pagefind/darwin-arm64/-/darwin-arm64-1.5.2.tgz", + "integrity": "sha512-MXpI+7HsAdPkvJ0gk9xj9g541BCqBZOBbdwj9g6lB5LCj6kSV6nqDSjzcAJwvOsfu0fjwvC8hQU+ecfhp+MpiQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/darwin-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/@pagefind/darwin-x64/-/darwin-x64-1.5.2.tgz", + "integrity": "sha512-IojxFWMEJe0RQ7PQ3KXQsPIImNsbpPYpoZ+QUDrL8fAl/O27IX+LVLs74/UzEZy5uA2LD8Nz1AiwKr72vrkZQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/linux-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/@pagefind/linux-arm64/-/linux-arm64-1.5.2.tgz", + "integrity": "sha512-Ovt9+K35sqzn8H3ZMXGwls4TD/wMJuvRtShHIsmUQREmaxjrDEX7gHckRCrwYJ4XE1H1p6HkLz3wukrAnsfXQw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/linux-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/@pagefind/linux-x64/-/linux-x64-1.5.2.tgz", + "integrity": "sha512-V+tFqHKXhQKq/WqPBD67AFy7scn1/aZID00ws4fSDd+1daSi5UHR9VVlRrOUYKxn3VuFQYRD7lYXdZK1WED1YA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/windows-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/@pagefind/windows-arm64/-/windows-arm64-1.5.2.tgz", + "integrity": "sha512-hN9Nh90fNW61nNRCW9ZyQrAj/mD0eRvmJ8NlTUzkbuW8kIzGJUi3cxjFkEcMZ5h/8FsKWD/VcouZl4yo1F7B6g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@pagefind/windows-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/@pagefind/windows-x64/-/windows-x64-1.5.2.tgz", + "integrity": "sha512-Fa2Iyw7kaDRzGMfNYNUXNW2zbL5FQVDgSOcbDHdzBrDEdpqOqg8TcZ68F22ol6NJ9IGzvUdmeyZypLW5dyhqsg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@rollup/pluginutils": { "version": "5.3.0", "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", @@ -4952,6 +5039,25 @@ "integrity": "sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==", "license": "MIT" }, + "node_modules/pagefind": { + "version": "1.5.2", + "resolved": "https://registry.npmmirror.com/pagefind/-/pagefind-1.5.2.tgz", + "integrity": "sha512-XTUaK0hXMCu2jszWE584JGQT7y284TmMV9l/HX3rnG5uo3rHI/uHU56XTyyyPFjeWEBxECbAi0CaFDJOONtG0Q==", + "dev": true, + "license": "MIT", + "bin": { + "pagefind": "lib/runner/bin.cjs" + }, + "optionalDependencies": { + "@pagefind/darwin-arm64": "1.5.2", + "@pagefind/darwin-x64": "1.5.2", + "@pagefind/freebsd-x64": "1.5.2", + "@pagefind/linux-arm64": "1.5.2", + "@pagefind/linux-x64": "1.5.2", + "@pagefind/windows-arm64": "1.5.2", + "@pagefind/windows-x64": "1.5.2" + } + }, "node_modules/parse-entities": { "version": "4.0.2", "resolved": "https://registry.npmmirror.com/parse-entities/-/parse-entities-4.0.2.tgz", diff --git a/package.json b/package.json index 9c58e6c..f8328eb 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "scripts": { "dev": "astro dev", - "build": "astro build", + "build": "astro build && pagefind --site dist", "preview": "astro preview", "astro": "astro" }, @@ -21,5 +21,8 @@ "rehype-pretty-code": "^0.14.3", "remark-math": "^6.0.0", "tailwindcss": "^4.2.4" + }, + "devDependencies": { + "pagefind": "^1.5.2" } }