-
Notifications
You must be signed in to change notification settings - Fork 66
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: adding search to docs #37
Conversation
THIS IS SO PRETTY! |
Could we please have the script to generate the index as part of a build script? |
The script is already a part of the PR ( |
There should be a |
Will do it. I will have to look up how to build the index in gh action and have it pushed to the branch. |
Technically it doesn't need to be checked in. We could generate it just-in-time before we either run locally (when we do |
That makes sense. |
@@ -20,7 +20,13 @@ | |||
"@fermyon/styleguide": "^0.1", | |||
"@parcel/transformer-sass": "^2.7.0", | |||
"nodemon": "^2.0.20", | |||
"sass": "^1.49.9" | |||
"sass": "^1.49.9", | |||
"args-parser": "^1.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please alphabetically order the imports?
Thanks!
Updated with |
I think what's confusing me is that the heading is showing up initially |
It shows up initially because the suggested pages is hardcoded. I could look into it and see what I can do. |
static/js/main.js
Outdated
class ModalSuggest { | ||
constructor() { | ||
this.spinPages = [ | ||
el("a.result-subitem", { href: "/spin/quickstart/", onclick: function (e) { searchModal.close() } }, [el("span.result-item-icon", "#"), el("span", "quickstart")]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"quickstart" should be "Quickstart"
I didn't even notice those were hardcoded suggestions :-) But the consistency with that list and what you can search for would be good. Maybe just add the suggestions as search terms? |
I also think it would probably be a good idea to represent the suggested list in a different manner than how search results appear. But I'll look to add those hardcoded strings as part of the index. Any thoughts? |
The quickstart debacle is because the title of the page in the sidebar is "quickstart", but the title of the markdown document is "Taking Spin for a spin". |
I think we need a keywords tag in the meta, which the indexer should parse. That way we can tweak the indexer without changing the look. @tpmccallum you must have good examples of how SEO works on the big Internet :-) |
If there is a keywords field in the frontmatter indexing it is straightforward. We can add a keywords field in the extra section of the frontmatter. I will update based on if we go down this route. I will also update the suggested post to name it "Taking Spin for a spin" to keep the result consistent. |
Added support for keywords, only added keywords for the quickstart page. There is currently a 10x boost for results from the keyword field so that would allow us to game which results should show up for certain keywords. It would probably be a better idea to add keywords to all the pages on a later PR. |
Added breadcrumbs and resolved #45. Will work on differentiating the suggested page from the search results next. Can add filters as well to show results from only a certain project. |
FYI - the |
In the last commit
ToDo
|
Should we merge now and start using it to get more feedback? Then optimize the indexer next week? |
Sounds like a good idea to me. I will rebase |
Signed-off-by: karthik Ganeshram <karthik.ganeshram@fermyon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let merge and then get the feedback
Still a major work in progress. Proof of concept at this point.
The command to gather the search index from the markdown files is
Then the search functionality can be tested using
PS: The parser is very hacky.
Signed-off-by: karthik Ganeshram karthik.ganeshram@fermyon.com