bevy-website icon indicating copy to clipboard operation
bevy-website copied to clipboard

Add search functionality using Pagefind

Open doup opened this issue 9 months ago β€’ 4 comments

This PR adds search functionality using Pagefind Rust based library. The search index built by Pagefind is generated based on the final website HTML files. Because of that I had to change the deploy action; now building with Zola, creating the search index and deploying are different steps.

For reviewers

You'll need to generate the Pagefind index, follow these instructions: https://github.com/doup/bevy-website/tree/pagefind-search?tab=readme-ov-file#local-development

Closes #1204.

image

image image image image

Deploy Settings

I had to use these settings to deploy with the new modified deploy action. Fine-grained PAT Permissions:

image

Also, had to add my branch pagefind-search to the repo Settings > Environments > Configure "github-pages" > Deployment branches and tags. So, main probably needs to be there.

doup avatar Feb 26 '25 17:02 doup

Thanks for the review @krunchington πŸ™ I'll ask for a new one once I fix the issues and finish the CI part.

doup avatar Mar 13 '25 13:03 doup

New changes look good!

krunchington avatar Mar 13 '25 15:03 krunchington

search button doesn't work for me

https://github.com/user-attachments/assets/cf4982dc-09eb-43b3-9830-4fdf7438f4b3

PS C:\Users\BenjaminBrienen\source\bevy-website> zola serve
Building site...
Warning: Highlight language shell not found in learn/migration-guides/0.11-to-0.12.md
Warning: Highlight language ron not found
Warning: Highlight language shell not found in learn/migration-guides/0.14-to-0.15.md
Warning: Highlight language shell not found in learn/migration-guides/0.14-to-0.15.md
Warning: Highlight language shell not found in learn/migration-guides/0.14-to-0.15.md
Warning: Highlight language shell not found in learn/migration-guides/0.14-to-0.15.md
Warning: Highlight language ron not found in learn/migration-guides/0.14-to-0.15.md
Warning: Highlight language ron not found in learn/migration-guides/0.14-to-0.15.md
Checking all internal links with anchors.
> Successfully checked 32 internal link(s) with anchors.
-> Creating 123 pages (0 orphan) and 35 sections
Done in 3.8s.

Listening for changes in \\?\C:\Users\BenjaminBrienen\source\bevy-website\{config.toml,content,sass,static,templates}
Press Ctrl+C to stop

Web server is available at http://127.0.0.1:1111 (bound to 127.0.0.1:1111)

BenjaminBrienen avatar May 16 '25 11:05 BenjaminBrienen

@BenjaminBrienen have you generated the Pagefind index? You'll need to follow these steps: https://github.com/doup/bevy-website/tree/pagefind-search?tab=readme-ov-file#local-development

Sorry, my bad, I forgot to mention it… πŸ˜…

doup avatar May 20 '25 07:05 doup