-
Notifications
You must be signed in to change notification settings - Fork 12
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
📦[WIP]: generate index from HTML meta #3
Conversation
super fancy! i like it a lot. is this good to merge or you still have some stuff todo? pls feel free to merge on your own but happy to give any opinions u want. its your project now as well as mine. you can also publish on npm now |
Awesome, that's really nice of you 🙌 Also, 2 last small things:
|
Hey 👋 I think I'm done with the PR, @sw-yx!
Feel free to review and merge if you will! |
published as v0.1.0! havent tested myself |
This PR replaces the currently generated searchable text with an array of weighted searchable items. It adds these keys to each item:
title
, extracted from tagdescription
, extracted from tagkeywords
, extracted from tag and transformed to arrayheadings
, an array of headings found in documenttext
, a lightweight version of previoushtml-to-text
outputimage
, image url extracted fromog:image
metafrom
, an array of folders and subfolders the file is stored inThese keys are then ordered by weight (see Fuse weighted search) and passed to generated function. Note that these are default values and should be overridable by the user.
Added config option: an
ignore
list of paths to be dismissed from search. I'm also planning to use thefrom
key to filter out the results, in order for the user to build features like "search in [...]"Directory read is now handled by
globby
.About replacing
html-to-text
withretext
: I mainly used it to keep the unifiedJS processor approach, but also because it could open the plugin to more features, eg.retext-keywords
. I don't know exactly the proshtml-to-text
, so maybe it does things better.. Let me know!Not everything has been carefully tested yet, but you can preview the result right away by running the (light) test suite 😊