-
Notifications
You must be signed in to change notification settings - Fork 382
Add search functionality using Pagefind #1935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
doup
wants to merge
80
commits into
bevyengine:main
Choose a base branch
from
doup:pagefind-search
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # templates/layouts/example.html # templates/shortcodes/release_notes.md
github-merge-queue bot
pushed a commit
to bevyengine/bevy
that referenced
this pull request
Mar 18, 2025
…kdown (#18191) # Objective Separate example explanation (file docblock) and the code so they can be layout differently in the website and we can give a higher importance to the explanation on the [website search tool](bevyengine/bevy-website#1935). This would also allow us to improve the examples so they become even more like a cookbook. ## Solution Update the `example-showcase` tool to extract the example file docblock and write it as the example markdown content. This allows us to access the explanation via `page.content` in Zola. ## Testing I've checked that the output is correct after running the tool and it doesn't throw any error. I've also validated that the approach will work on the website. ## Showcase This is a quick and dirty example of what we could do in the web examples after the change. When we implement the real thing we can put the explanation on a sidebar or explore other layout options. <img width="1362" alt="image" src="https://github.com/user-attachments/assets/6738542e-31c3-41cd-972a-7fa2e942e85d" />
github-merge-queue bot
pushed a commit
to bevyengine/bevy
that referenced
this pull request
Mar 19, 2025
…kdown (#18191) # Objective Separate example explanation (file docblock) and the code so they can be layout differently in the website and we can give a higher importance to the explanation on the [website search tool](bevyengine/bevy-website#1935). This would also allow us to improve the examples so they become even more like a cookbook. ## Solution Update the `example-showcase` tool to extract the example file docblock and write it as the example markdown content. This allows us to access the explanation via `page.content` in Zola. ## Testing I've checked that the output is correct after running the tool and it doesn't throw any error. I've also validated that the approach will work on the website. ## Showcase This is a quick and dirty example of what we could do in the web examples after the change. When we implement the real thing we can put the explanation on a sidebar or explore other layout options. <img width="1362" alt="image" src="https://github.com/user-attachments/assets/6738542e-31c3-41cd-972a-7fa2e942e85d" />
mockersf
pushed a commit
to bevyengine/bevy
that referenced
this pull request
Mar 19, 2025
…kdown (#18191) # Objective Separate example explanation (file docblock) and the code so they can be layout differently in the website and we can give a higher importance to the explanation on the [website search tool](bevyengine/bevy-website#1935). This would also allow us to improve the examples so they become even more like a cookbook. ## Solution Update the `example-showcase` tool to extract the example file docblock and write it as the example markdown content. This allows us to access the explanation via `page.content` in Zola. ## Testing I've checked that the output is correct after running the tool and it doesn't throw any error. I've also validated that the approach will work on the website. ## Showcase This is a quick and dirty example of what we could do in the web examples after the change. When we implement the real thing we can put the explanation on a sidebar or explore other layout options. <img width="1362" alt="image" src="https://github.com/user-attachments/assets/6738542e-31c3-41cd-972a-7fa2e942e85d" />
…-search # Conflicts: # sass/_vars.scss
…-search # Conflicts: # sass/_vars.scss
…-search # Conflicts: # templates/docs.html
search button doesn't work for me Screen.Recording.2025-05-16.131636.mp4
|
@BenjaminBrienen have you generated the Pagefind index? You'll need to follow these steps: Sorry, my bad, I forgot to mention it… 😅 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Deploy Settings
I had to use these settings to deploy with the new modified
deploy
action. Fine-grained PAT Permissions:Also, had to add my branch
pagefind-search
to the repoSettings > Environments > Configure "github-pages" > Deployment branches and tags
. So,main
probably needs to be there.