-
Notifications
You must be signed in to change notification settings - Fork 125
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
Can pagefind pull its data from a json index file? #277
Comments
No directly, no, and the primary goal is still to index from HTML. There's a little bit of discussion for this in #142, and ultimately this flow will be made possible with the release of #72 by using a NodeJS interface to populate a search index. (Closing this issue but feel free to jump into either of the linked issues) |
Just dropping a notification here that the Node API has shipped in v1.0.0! |
That is exciting, I am going to experiment with it once I get some free time, thanks! |
Hi! @Jieiku |
Yes, this was recently implemented in the abridge theme for Zola, I was already making use of a node script in the abridge theme so that made things a little more staightforward. This was discussed a bit here Jieiku/abridge#178 and was implemented by @Hysterelius here: Jieiku/abridge@a7244a2 EDIT: Once I have time I will put a demo of abridge online that is using pagefind. (The Abridge demo by default uses elasticlunr because not everyone using Zola is interested in using node/npm) |
...thank you reply ... I want to try to use this JS for Jekyll static site generator.. What do you think this is good idea? |
I have never used jekyll but the pagefind node api seems versatile enough that it should work with any static site generator if your willing/able to do the work implementing it and using npm/node is not a problem. |
The demo can be seen here https://abridge-pagefind.pages.dev/ |
I ask because in many static site generators it would be rather simple to generate an index during site build that contains the data that you wish pagefind to index.
I do something similar for generating the json for tinysearch in my zola site:
https://github.com/Jieiku/abridge/blob/master/templates/tinysearch_json.html
When I issue a
zola build
, the above linked template generates json data, I then use the tinysearch executable to consume that json data and generate the real index that tinysearch will use.So basically the json index that I generate from zola is an intermediate index.
The demo for that search is here: https://jieiku.github.io/abridge-tinysearch/
tinysearch uses bloom filters so in the below json I also have a 'meta' field which is meant to be the data to include as a description of the indexed link. For pagefind you would likely only have title, url, body
this is what that intermediate json data looks like:
The text was updated successfully, but these errors were encountered: