Please confirm that you have searched existing issues in the repo
Yes, I have searched the existing issues
Any related issues?
#205
What is the area that this feature belongs to?
No response
Is your feature request related to a problem? Please describe.
Pagefind configuration in MarkBind currently exists as a separate pagefind object in site.json, disconnected from the pages array where content scoping is already defined:
{
"pagefind": {
"exclude_selectors": [".algolia-no-index"],
"glob": ["**/api/**"]
}
"pages": [...],
}
The searchable option on pages already determines which pages should be indexed by the built-in search. However, pagefind.glob requires separately declaring which globs to include.
As the goal is to integrate pagefind as the default search within Markbind (eventually replacing the built-in search), the current implementation results in redundancy as users will have to declare the seperate
Hence, we should take advantage of the current searchable option to
- Remove the redundancy incurred from above
- Support a more seamless onboarding/switching process from the current built-in search to pagefind search.
Describe the solution you'd like
Align pagefind's glob-based exclusion with existing src/glob patterns used within pages.
{
"pages": [
{
"glob": "**/guide_1/**",
"searchable": false
}
]
}
From the above example, pagefind should be able NOT be indexing any pages with the pattern **/guide_1/** while all other pages should be indexed.
Potential implementation steps:
- Modify
SitePagesManager & SiteConfig.ts to derive Pagefind glob patterns from pages where searchable !== false
- Update
SiteGenerationManager.ts to use derived globs in indexSiteWithPagefind()
- Remove current pagefind's
glob options from SiteConfig.ts
Describe alternatives you've considered
No response
Additional context
No response
Please confirm that you have searched existing issues in the repo
Yes, I have searched the existing issues
Any related issues?
#205
What is the area that this feature belongs to?
No response
Is your feature request related to a problem? Please describe.
Pagefind configuration in MarkBind currently exists as a separate
pagefindobject insite.json, disconnected from the pages array where content scoping is already defined:{ "pagefind": { "exclude_selectors": [".algolia-no-index"], "glob": ["**/api/**"] } "pages": [...], }The
searchableoption on pages already determines which pages should be indexed by the built-in search. However,pagefind.globrequires separately declaring which globs to include.As the goal is to integrate pagefind as the default search within Markbind (eventually replacing the built-in search), the current implementation results in redundancy as users will have to declare the seperate
Hence, we should take advantage of the current
searchableoption toDescribe the solution you'd like
Align pagefind's glob-based exclusion with existing src/glob patterns used within pages.
{ "pages": [ { "glob": "**/guide_1/**", "searchable": false } ] }From the above example, pagefind should be able NOT be indexing any pages with the pattern
**/guide_1/**while all other pages should be indexed.Potential implementation steps:
SitePagesManager&SiteConfig.tsto derive Pagefind glob patterns from pages wheresearchable !== falseSiteGenerationManager.tsto use derived globs inindexSiteWithPagefind()globoptions fromSiteConfig.tsDescribe alternatives you've considered
No response
Additional context
No response