-
Notifications
You must be signed in to change notification settings - Fork 104
docs: add search (Algolia DocSearch) #310
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
Comments
great idea :) let me know if you need help implementing it! |
Hey @justinmk, I was browsing the docs today and saw some potential improvements of the crawler config, here's an example of some changes I've made https://crvdgc.csb.app/ If you like it let me know, I could update the config for the nvim crawler :D |
@shortcuts absolutely, can you share the config changes here? First thing I noticed is that the search results doesn't have that weird space. neovim.io (has a weird space): ![]() your site: ![]() |
Sure, I only changed the recordProps: {
lvl0: {
selectors: [
"header h1",
"article h1",
"main h1",
"h1",
"head > title",
],
defaultValue: "Documentation",
},
lvl1: ["article h2", "main h2", "h2"],
lvl2: ["article h3", "main h3", "h3"],
lvl3: ["article h4", "main h4", "h4"],
lvl4: ["article h5", "main h5", "h5"],
lvl5: ["article h6", "main h6", "h6"],
content: [".help-tag", ".help-tag-right"],
},
I guess there might be some theming overlap with your CSS, looking at the code I can see that bootstrap apply some padding over the |
hey @justinmk, I have a bit of time this weekend if you want I can provide a PR to fix the DocSearch style along with updating the config on the Algolia side |
@shortcuts yes, style updates are very appreciated whenever you get a chance.
If you have other config hints to share please do, though I guess that can't be done as a PR. |
sure, will take a look :)
I don't have other hints for now but as I'm a DocSearch maintainer and I work on the Crawler at Algolia, I can update the config from there if you don't have time to do it |
Interesting... 😆 yes, that would be great! The "diff" of changes would be nice to see here, for reference. |
Nice, looks good! I see that I had lvl1 messed up. |
Problem: The default bootstrap style adds padding to the `mark` element, which adds unwanted space in the Algolia DocSearch results. Solution: Override the `mark` element, only if it's a child of the `DocSearch` class. Discussed in #310
sitemap.xml
(also apparently helps with SEO)... can be generated bygen_help_html.lua
<h1>, ..., <h6>
headings of your page to guess the hierarchy.DocSearch-content
<p>
or<li>
tag. This content must be atomic and split into small entities.Alternatives
if Algolia doesn't work for some reason...
The text was updated successfully, but these errors were encountered: