Skip to content

Conversation

@confused-Techie
Copy link
Member

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.js file to the root of the ./docs directory. This file outputs search-index.jsonl to 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 website
  • title: The title of the page
  • body: 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 html extension when they are done being processed.


As for actually implementing search there's a few ways:

  • Use this index file client side to build an in memory index to search with, and process it all locally. Although this file is huge, so it might impact performance on users devices to download this
  • Use a pre-built service for search, which will also need (in general) an index of the site in some form.
  • Something much more custom, which would also need an index file.

So while I'd like to still play around with ideas, it makes sense that this is a first stepping stone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants