Skip to content

Commit fdd5f06

Browse files
bernatfpclaude
andcommitted
fix: add pagefind for static export search functionality
- Add pagefind as devDependency (^1.2.1) - Add postbuild script to generate search index - Add _pagefind/ to .gitignore - Configure pagefind to index .next/server/app and output to out/_pagefind This fixes the production search error where pagefind.js was not found. With static export, pagefind needs to run post-build to generate the search index from the built HTML files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 26143fc commit fdd5f06

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# Next.js
1010
/.next/
1111
/out/
12+
_pagefind/
1213

1314
# Production
1415
/build

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"dev": "next dev",
88
"build": "next build",
9+
"postbuild": "pagefind --site .next/server/app --output-path out/_pagefind",
910
"start": "next start",
1011
"export": "next build",
1112
"lint": "next lint",
@@ -36,6 +37,7 @@
3637
"eslint-plugin-jsx-a11y": "^6.10.2",
3738
"husky": "^9.1.7",
3839
"lint-staged": "^15.2.11",
40+
"pagefind": "^1.2.1",
3941
"prettier": "^3.4.2",
4042
"typescript": "^5.7.2"
4143
},

0 commit comments

Comments
 (0)