File tree Expand file tree Collapse file tree 6 files changed +39
-1
lines changed Expand file tree Collapse file tree 6 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,6 @@ gem --version
44bundle --version
55
66bundle exec jekyll build
7+
8+ # create search index under _site/pagefind
9+ ./pagefind --verbose --site _site
Original file line number Diff line number Diff line change 3636 with :
3737 ruby-version : 2.7
3838 bundler-cache : true
39+
40+ # Download and install the Pagefind binary
41+ # see releases: https://github.com/CloudCannon/pagefind/releases
42+ - name : Install Pagefind for Search
43+ run : |
44+ curl -L https://github.com/CloudCannon/pagefind/releases/download/v1.3.0/pagefind-v1.3.0-x86_64-unknown-linux-musl.tar.gz \
45+ -o pagefind.tar.gz
46+ tar xzf pagefind.tar.gz
47+ chmod +x pagefind
48+
3949 - name : Build
4050 run : |
4151 ./.github/scripts/docs.sh
52+
53+
Original file line number Diff line number Diff line change 66/vendor /
77/bundler /
88.jekyll-metadata
9+ pagefind *
Original file line number Diff line number Diff line change @@ -64,4 +64,5 @@ exclude:
6464 - ' .project'
6565 - ' run.sh'
6666 - ' /vendor'
67+ - ' /pagefind'
6768
Original file line number Diff line number Diff line change 77
88 < div class ="row main-container ">
99
10+ < link href ="/pagefind/pagefind-ui.css " rel ="stylesheet ">
11+ < script src ="/pagefind/pagefind-ui.js "> </ script >
12+ < div id ="search "> </ div >
13+ < script >
14+ window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
15+ new PagefindUI ( { element : "#search" , showSubResults : true } ) ;
16+ } ) ;
17+ </ script >
18+
1019 <!-- Main Content -->
1120 < div class ="large-9 medium-8 medium-push-4 large-push-3 columns ">
1221 < div class ="off-canvas-wrap move " data-offcanvas >
2130 </ aside >
2231
2332 <!-- main content goes here -->
33+ < main data-pagefind-body >
2434 {{content}}
25-
35+ </ main >
2636 <!-- close the off-canvas menu -->
2737 < a class ="exit-off-canvas "> </ a >
2838
Original file line number Diff line number Diff line change 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 -w --incremental
9+
10+ # Run and serve the _site folder with search working
11+ ./pagefind --site _site --serve
You can’t perform that action at this time.
0 commit comments