Skip to content

Commit 913b57d

Browse files
committed
add pagefind section to README
Signed-off-by: Christoph Rueger <[email protected]>
1 parent 8dc1cf6 commit 913b57d

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,40 @@ This should install jekyll and start a local webserver at:
1616

1717
Start editing markdown `.md` files. Jekyll will auto-detect changes and reload the website. Some changes require a restart (e.g. changes to `_config.yml`)
1818

19+
## Local development with Pagefind search
20+
21+
We use https://pagefind.app/ for our search field full text search.
22+
But it is currently not automatically working when using `./run.sh` above, because it works on the
23+
actual build-output on the `_site` folder (which contains the actual `.html` pages).
24+
25+
To test the search locally based on the `_site` folder content, run:
26+
27+
28+
`./run-pagefind-linux.sh`
29+
30+
or
31+
32+
`run-pagefind-macos.sh`
33+
34+
depending on which operating system you are using.
35+
36+
The result should look like:
37+
38+
`Serving "_site" at http://localhost:1414`
39+
40+
41+
The script will download and execute the pagefind executable binary after the build.
42+
Then it will start a small server where you test the result.
43+
Note, that this is different than the `./run.sh` and does not support real-time editing of the content.
44+
45+
Feel free to adjust / extend the start-scripts if you have a different architecture
46+
or to use a different `pagefind` version.
47+
48+
### pagefind for production build via github actions
49+
50+
See the files `.github/workflows/cibuild.yml` and `.github/scripts/docs.sh` for how
51+
building the site and executing `pagefind` is done in the final build on github.
52+
1953
### CSS Styling for Code Highlighter
2054

2155
- jekyll uses `rouge` code highlighter

run-pagefind.sh renamed to run-pagefind-linux.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ set -ev
55
export BUNDLE_GEMFILE=$PWD/Gemfile
66
bundle install --jobs=3 --retry=3 --path=vendor
77
bundle exec jekyll clean
8-
bundle exec jekyll build -w --incremental
8+
bundle exec jekyll build
99

1010
# Run and serve the _site folder with search working
11+
# install Linux x86_64
12+
curl -L https://github.com/CloudCannon/pagefind/releases/download/v1.3.0/pagefind-v1.3.0-x86_64-unknown-linux-musl.tar.gz -o pagefind.tar.gz
13+
tar xzf pagefind.tar.gz
14+
chmod +x pagefind
1115
./pagefind --site _site --serve

run-pagefind-macos.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -ev
3+
4+
# Build into _site folder
5+
export BUNDLE_GEMFILE=$PWD/Gemfile
6+
bundle install --jobs=3 --retry=3 --path=vendor
7+
bundle exec jekyll clean
8+
bundle exec jekyll build
9+
10+
# Run and serve the _site folder with search working
11+
# install for MacOS aarch64
12+
curl -L https://github.com/CloudCannon/pagefind/releases/download/v1.3.0/pagefind-v1.3.0-aarch64-apple-darwin.tar.gz -o pagefind.tar.gz
13+
tar xzf pagefind.tar.gz
14+
chmod +x pagefind
15+
./pagefind --site _site --serve

0 commit comments

Comments
 (0)