-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Add Pagefind weight frontmatter #2371
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 820161b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
size-limit report 📦
|
## Adjust ranking in search results | ||
|
||
Pagefind's index ranking can be adjusted using the [`data-pagefind-weight`](https://pagefind.app/docs/weighting/#ranking-content-higher-or-lower) attribute. This can be used to [adjust a whole page](#adjust-whole-page-rank) or [individual sections of a page](#adjust-individual-section-rank). | ||
|
||
Learn more about about how the weight value impacts search results in the [Pagefind Weighting content guide](https://pagefind.app/docs/weighting/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to explain to users when they should change the ranking, and why. The docs of pagefind only explain some technical stuff, but from the point of view of a maintainer like myself, it would be nice to have some guidance on why I should use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Adjust ranking in search results | |
Pagefind's index ranking can be adjusted using the [`data-pagefind-weight`](https://pagefind.app/docs/weighting/#ranking-content-higher-or-lower) attribute. This can be used to [adjust a whole page](#adjust-whole-page-rank) or [individual sections of a page](#adjust-individual-section-rank). | |
Learn more about about how the weight value impacts search results in the [Pagefind Weighting content guide](https://pagefind.app/docs/weighting/). | |
## Adjust ranking in search results | |
Pagefind's index ranking can be adjusted using the [`data-pagefind-weight`](https://pagefind.app/docs/weighting/#ranking-content-higher-or-lower) attribute. This can be used to [adjust a whole page](#adjust-whole-page-rank) or [individual sections of a page](#adjust-individual-section-rank). | |
For example, if there is a high-level guide that is a better entry point for readers than an error reference page containing similar keywords, increasing the weight of the guide page will cause it to be ranked higher in the Pagefind search results. | |
Learn more about about how the weight value impacts search results in the [Pagefind Weighting content guide](https://pagefind.app/docs/weighting/). |
@ematipico Thanks! Do you think this gives a good example of the usage here? Happy for any suggestions if anything else comes to mind 🥳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're getting somewhere I think. Now we should explain when to increase the page weight and when decrease the page weight.
Description
pagefind.weight
property for page frontmatter to adjust the search index weightQuestion
By keeping the
weight
key required if it's an object for now, we can still add more keys in the future and mark theweight
key as optional without any breaking change issues, right? Or would it be better to mark it as "optional" now and handle that additional check in this PR?