Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Add content to search index #1

Merged
merged 9 commits into from
Nov 11, 2019

Conversation

patrickdaze
Copy link
Contributor

@patrickdaze patrickdaze commented Oct 31, 2019

This PR adds the contents of pages to the search index. The current search index only has page title.

PR improves search by:

  • Allowing to search deeper into the documentation (queries such as "has-text" or "input size")
  • Providing more search results for short queries (such as "nested").

While this PR might not be best the long term solution, I think it's more than sufficient for the time being. A better solution might be something like algolia/jekyll-algolia, or DocSearch.

PR Contents

  • Added dotenv
  • Indexer refactor
  • Adds page content search index
  • Adds page sections to search index: allows to skip to more relevant content within a single page
  • Frontend (search UI) updated to display relevant page content

Demo

Hosted: https://elegant-fermi-69a8e6.netlify.com/

Side-by-side comparison: Image

@zoe-edwards
Copy link
Owner

zoe-edwards commented Nov 4, 2019

A-ma-zing

Would it be possible to format the PHP to meet PSR?

@patrickdaze
Copy link
Contributor Author

Sure can! With a couple of manual changes (namespaces, etc), automating it would probably be a good option.

I can set things up to work with StyleCI or PHP CS Fixer.

@ThomasEdwards Preference between StyleCI or PHP CS Fixer?

@zoe-edwards
Copy link
Owner

Not used either before! StyleCI looks like a good start – have signed up, hopefully will come through here.

@patrickdaze
Copy link
Contributor Author

I applied code style fixes conforming to #4

@zoe-edwards zoe-edwards merged commit 1568f71 into zoe-edwards:master Nov 11, 2019
patrickdaze added a commit to patrickdaze/bulma-search-chrome that referenced this pull request Feb 17, 2020
@patrickdaze patrickdaze deleted the index-content branch October 9, 2020 18:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants