Skip to content
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

Is there a way to define pagefind config? #87

Open
kolyasya opened this issue Aug 10, 2024 · 2 comments
Open

Is there a way to define pagefind config? #87

kolyasya opened this issue Aug 10, 2024 · 2 comments

Comments

@kolyasya
Copy link

kolyasya commented Aug 10, 2024

Hey, thanks for a great package.

I wonder if there is a way to define config options for pagefind, because I want to adjust index for my app.

Looks like it receives an empty options object here:
https://github.com/shishkin/astro-pagefind/blob/main/packages/astro-pagefind/src/pagefind.ts#L58

Btw, I see that it is implemented in another integration
https://github.com/itsmatteomanf/astro-components/blob/main/packages/astro-pagefind/src/integration.ts#L38

@shishkin
Copy link
Owner

Thanks. It's totally doable. I just never had a use case for that and wonder which options would make send to pass through. I definitely would like to avoid complicating the integration and face possible inconsistencies later. Looking through the createIndex args it seems at least harmless to pass them through. So what is your use case for overriding those options?

@kolyasya
Copy link
Author

@shishkin I was just trying to index only headings and figured out what I can to that with data-xxxxx tags according to pagefind docs.

But anyway for me it looks like in any library which is written over another one there is always a way to pass params like: pagefindOptions: { ... } and everything just goes through.

I see that the package I mentioned has a validation for these params which is nice, but not critical. It is the user's responsibility to check the docs and pass the correct params :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants