Implement Search Feature #40
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For any good documentation website, users need the ability to search the content to find what they are looking for.
Currently we have no methodology to search.
So really with just about any solution we go with, we will need to at some point generate an index of our content.
To this effect I've added the
seach-index.11ty.jsfile to the root of the./docsdirectory. This file outputssearch-index.jsonlto the root of the website containing a JSON Lines index file of the entire website, with the following properties:url: The path to the file on the websitetitle: The title of the pagebody: The HTML content of the document itself, before being passed through it's templates, so it excludes all the extra HTML fluff it's about to get.In this index file we only store files that will have an
htmlextension when they are done being processed.As for actually implementing search there's a few ways:
So while I'd like to still play around with ideas, it makes sense that this is a first stepping stone.