@@ -55,52 +55,36 @@ Adding a standard library doc page works almost the same as tutorials.
5555 - Change the ` sections ` to match the uri of the pages of your tutorial.
5656* Write your new_doc pages, being sure to update the heading sections as necessary.
5757
58- ## Building Search Index
58+ ## Search Index
5959
60- The site now uses ` pagefind ` for fully local static search. No external API key is required.
60+ The site uses [ ` pagefind ` ] ( https://pagefind.app/ ) for fully local static search. No external API key is required.
6161
62- For GitHub Pages compatibility, the generated ` pagefind/ ` folder is committed to this repository.
62+ ** The index is generated automatically by CI on every deploy** — see
63+ [ ` .github/workflows/pages.yml ` ] ( .github/workflows/pages.yml ) . It builds the
64+ site, runs Pagefind against the * built* ` _site ` , and deploys the result to
65+ GitHub Pages. Because the index is rebuilt from the actual content on every
66+ deploy, it can never drift out of sync.
6367
64- 1 . Build the site:
68+ > ** Do not commit a ` pagefind/ ` folder.** It is ` .gitignore ` d on purpose. A
69+ > hand-committed index drifts from the content and breaks search (you get
70+ > "SEARCH INDEX NOT FOUND" on the live site). Let CI generate it.
6571
66- ` bundler exec jekyll build `
72+ ### One-time GitHub setup
6773
68- 2 . Generate the search index into ` _site/pagefind ` :
74+ In repo ** Settings → Pages → Build and deployment** , set ** Source** to
75+ ** "GitHub Actions"** . The workflow then publishes the site (custom domain
76+ ` wurstlang.org ` is preserved via the ` CNAME ` file).
6977
70- ` npx -y pagefind --site _site `
71-
72- 3 . Sync the generated index into tracked ` pagefind/ ` :
73-
74- ` rm -rf pagefind && cp -R _site/pagefind ./pagefind `
75-
76- PowerShell equivalent:
77-
78- ` if (Test-Path pagefind) { Remove-Item -Recurse -Force pagefind }; Copy-Item -Recurse _site/pagefind ./pagefind `
79-
80- 4 . Serve ` _site ` (or deploy it). Search will load from ` /pagefind/pagefind.js ` .
81-
82- Prerequisite for indexing: Node.js (for ` npx pagefind ` ).
83-
84- ### Pre-commit Hook For Indexing
85-
86- Set up repo hooks once:
87-
88- ` git config core.hooksPath .githooks `
89-
90- Then every commit will:
91-
92- 1 . Build Jekyll
93- 2 . Generate Pagefind index
94- 3 . Sync ` _site/pagefind ` to tracked ` pagefind/ `
95- 4 . Auto-stage ` pagefind/ `
96-
97- To bypass once:
78+ ### Local dev with ` jekyll serve `
9879
99- ` SKIP_PAGEFIND_HOOK=1 git commit ... `
80+ ` jekyll serve ` does not generate a search index. To preview search locally:
10081
101- PowerShell equivalent:
82+ 1 . Build the site: ` bundle exec jekyll build `
83+ 2 . Generate the index into ` _site/pagefind ` : ` npx -y pagefind@1.5.2 --site _site `
84+ 3 . Serve ` _site ` (e.g. ` npx -y serve _site ` ). Search loads from ` /pagefind/pagefind.js ` .
10285
103- ` $env:SKIP_PAGEFIND_HOOK='1'; git commit ...; Remove-Item Env:SKIP_PAGEFIND_HOOK `
86+ Repeat steps 1–2 after content changes you want reflected in local search.
87+ Prerequisite: Node.js (for ` npx pagefind ` ).
10488
10589### Jenkins
10690
@@ -116,17 +100,3 @@ To use it:
1161001 . Create a Jenkins Pipeline (or Multibranch Pipeline) job for this repository.
1171012 . Keep script source as ` Jenkinsfile ` in SCM.
1181023 . Ensure the Jenkins agent has Ruby/Bundler and Node.js/npm available.
119-
120- ### Local dev with ` jekyll serve `
121-
122- ` jekyll serve ` rebuilds ` _site ` . To keep local search working:
123-
124- 1 . Start Jekyll:
125-
126- ` bundler exec jekyll serve `
127-
128- 2 . In a second terminal, generate Pagefind index:
129-
130- ` npx -y pagefind --site _site `
131-
132- 3 . Repeat step 2 after content changes that should be searchable.
0 commit comments