From d1297cde6d574ef16de73625bb1546664355c9db Mon Sep 17 00:00:00 2001 From: Inessa Pawson Date: Tue, 29 Sep 2026 19:43:55 -0400 Subject: [PATCH] ENH: enable site search with pagefind --- .github/workflows/gh-pages.yml | 3 +++ Makefile | 8 +++++--- config.yaml.in | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 8d29fe655a..eb4644ab3b 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -60,6 +60,9 @@ jobs: export PATH=$(pwd)/dart-sass:$PATH hugo --gc --minify + - name: Build search index + run: npx --yes pagefind@1.5.2 --site public + - name: Deploy pages uses: JamesIves/github-pages-deploy-action@releases/v4 with: diff --git a/Makefile b/Makefile index cc7660544f..e071bb4644 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -# type `make help` to see all options +# type `make help` to see all options -BASEURL ?= +BASEURL ?= ifdef BASEURL BASEURLARG=-b $(BASEURL) -endif +endif .PHONY: help prepare teams-clean teams serve clean @@ -41,8 +41,10 @@ serve-dev: python gen_config.py hugo $(BASEURLARG) --printI18nWarnings server --buildDrafts --disableFastRender --poll 1000ms +PAGEFIND = npx --yes pagefind@1.5.2 --site public html: prepare ## build the website in ./public hugo $(BASEURLARG) + $(PAGEFIND) clean: ## remove the build artifacts, mainly the "public" directory rm -rf public diff --git a/config.yaml.in b/config.yaml.in index 8612c3ef01..94d7146fc2 100644 --- a/config.yaml.in +++ b/config.yaml.in @@ -14,6 +14,7 @@ markup: disableLanguages: [] params: + search: true colorScheme: light author: name: "NumPy team"