From 1c25e1830fa0528bbd8ebf29d777628478822d2f Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Sat, 16 Sep 2023 22:01:01 -0700 Subject: [PATCH] Integrate pagefind search --- Makefile | 4 ++++ build.py | 5 ----- src/index.md | 4 +++- src/search/index.md | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 src/search/index.md diff --git a/Makefile b/Makefile index 4912282..2bc9d58 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,10 @@ build: ./build.py + pagefind --site out/ + +clean: + test -e out && rm -rf out watch: while sleep 1; do find src/ build.py Makefile | entr -d make build; done diff --git a/build.py b/build.py index 7abeae8..a3dcab1 100755 --- a/build.py +++ b/build.py @@ -22,11 +22,6 @@ def main(): md = markdown.Markdown(extensions=["attr_list", "footnotes", "md_in_html", "meta"]) comment_md = markdown.Markdown() - # Clean the output directory - if out.exists(): - print("Removing ", out) - shutil.rmtree(out) - # Load the template template = bs4.BeautifulSoup( (src / ".template.html").read_text(encoding="utf8"), diff --git a/src/index.md b/src/index.md index 82f4e38..b4632e4 100644 --- a/src/index.md +++ b/src/index.md @@ -6,4 +6,6 @@ title: Home => [Projects I've worked on](./project/). -=> [About this site](./about/). \ No newline at end of file +=> [About this site](./about/). + +=> [Search this site](./search/). diff --git a/src/search/index.md b/src/search/index.md new file mode 100644 index 0000000..ca51d3a --- /dev/null +++ b/src/search/index.md @@ -0,0 +1,14 @@ +--- +title: Search +--- + +Search results generated by [Pagefind](https://pagefind.app/). + + + + + \ No newline at end of file