Skip to content
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

Search page #888

Closed
wants to merge 11 commits into from
Closed

Search page #888

wants to merge 11 commits into from

Conversation

tdelmas
Copy link
Collaborator

@tdelmas tdelmas commented Feb 3, 2020

Just a proof of concept, to discuss about it, see if it may be useful.

image

image

https://deploy-preview-888--letsencrypt.netlify.com/search/

And for the 404:

image

@pgporada
Copy link
Member

pgporada commented Feb 3, 2020

The search feature would be helpful because I often find myself grepping through this git repository to find specific blog pages.

@tdelmas
Copy link
Collaborator Author

tdelmas commented Feb 3, 2020

Thank you for the feedback!

@jsha
Copy link
Contributor

jsha commented Feb 4, 2020

Interesting! I'm in favor of adding a search. How does this work? Is it a pure-JS search? That's pretty amazing if so.

@tdelmas
Copy link
Collaborator Author

tdelmas commented Feb 4, 2020

@jsha thank you! Hugo's help page https://gohugo.io/tools/search/ was really useful, and a special thanks to @sebz's and @eddiewebb's gists is needed 😄

Technically speaking:

  • index.json contains the list of pages (with the text content and a few metadata)
  • The javascript download it and uses a the JS library Fuse to generate a sorted list of results

So yes, 100% js front-end, with no external dependency.

The json file is only ~1.5Mo for English (so with all blog posts), less than 500ko on the network with the compression, which is reasonable (but still require a waiting indicator)

Tom Delmas added 2 commits February 5, 2020 21:09
Uses do_not_search from letsencrypt#903 to:
- Remove the search page from search engines
- In the search page result, to not display do_not_index pages
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.

Feature Request - Please add a search feature to the website/documentation
3 participants