Add site search (Pagefind)
Client-side index generated after the Hugo build; search box in the header, results page with a section filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
OC ?= ../oc
|
||||
# not public/: a running `hugo server` renders there, with its live-reload script
|
||||
BUILD ?= build
|
||||
# search index generator (https://pagefind.app), fetched by npx on first use
|
||||
PAGEFIND ?= npx -y pagefind@1
|
||||
# test server: the web share of barbel-lescar, mounted from the file manager (smb://barbel-lescar/web)
|
||||
DEPLOY_DIR ?= /run/user/$(shell id -u)/gvfs/smb-share:server=barbel-lescar,share=web/oldcomputers
|
||||
DEPLOY_URL ?= https://barbel.synology.me/oldcomputers/
|
||||
@@ -10,9 +12,10 @@ DEPLOY_URL ?= https://barbel.synology.me/oldcomputers/
|
||||
content: ## regenerate content/ and static/media/ from the extraction repo
|
||||
python3 $(OC)/scripts/05_hugo.py --target $(CURDIR)
|
||||
|
||||
build: ## build the site into $(BUILD)/
|
||||
build: ## build the site and its search index into $(BUILD)/
|
||||
rm -rf $(BUILD)
|
||||
hugo --panicOnWarning --minify -d $(BUILD)
|
||||
$(PAGEFIND) --site $(BUILD)
|
||||
|
||||
check: build ## build, then verify every internal link and image
|
||||
python3 tools/check_links.py $(BUILD)
|
||||
|
||||
Reference in New Issue
Block a user