Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Switch to Algolia DocSearch #85

Merged
merged 8 commits into from
Apr 30, 2020
Merged

Switch to Algolia DocSearch #85

merged 8 commits into from
Apr 30, 2020

Conversation

Soitora
Copy link
Member

@Soitora Soitora commented Oct 9, 2019

Switches from the regular search to the much more powerful Algolia one, not sure if it's ready yet or not but I'd prefer a better way to style it rather than doing !important in the .scss file.

PR'd so you can preview the build.

@netlify
Copy link

netlify bot commented Oct 9, 2019

Deploy preview for tachiyomi ready!

Built with commit 0a380a2

https://deploy-preview-85--tachiyomi.netlify.app

@joseph619
Copy link
Contributor

Nice! This should also take care of #26

src/.vuepress/styles/_variables.scss Outdated Show resolved Hide resolved
src/.vuepress/styles/index.scss Outdated Show resolved Hide resolved
src/.vuepress/styles/index.scss Outdated Show resolved Hide resolved
src/.vuepress/config.js Outdated Show resolved Hide resolved
@Soitora
Copy link
Member Author

Soitora commented Jan 8, 2020

Overhauled everything, I can't avoid the !important styles yet because the component is wonky (and I don't know how to eject) (vuejs/vuepress#331)

There are some issues which is mainly due to our setup and not Algolia itself:

  • Sometimes when searching a header is empty, I guess because it's searching top-level and can't find an above header.
  • Headers with badge next to them gets included as pure text
  • Text with icon next to them gets the icon name included as pure text

@Soitora Soitora added the Help Wanted Help wanted with Issue/PR. label Jan 8, 2020
@arkon
Copy link
Contributor

arkon commented Jan 9, 2020

This seems relevant: https://community.algolia.com/docsearch/tips.html

@Soitora
Copy link
Member Author

Soitora commented Jan 9, 2020

That's good documentation, can maybe look into it today after I visit the ER.
Maybe something like https://github.com/ekoeryanto/vuepress-plugin-sitemap

@Soitora Soitora changed the title Switch to Algolia DocSearch [WIP] Switch to Algolia DocSearch Feb 4, 2020
@Soitora Soitora linked an issue Mar 5, 2020 that may be closed by this pull request
@Soitora Soitora marked this pull request as draft April 27, 2020 16:47
@Soitora Soitora removed the Help Wanted Help wanted with Issue/PR. label Apr 30, 2020
@Soitora Soitora marked this pull request as ready for review April 30, 2020 15:00
@Soitora Soitora requested a review from arkon April 30, 2020 15:00
@Soitora
Copy link
Member Author

Soitora commented Apr 30, 2020

Got Algolia to reindex the page (it's supposed to be automatic but I guess not touching it for ~200 days made it go idle), also changed from using a stylesheet to replace styles I just modified the ejected component instead.

It's an old PR so I'm not 100% sure of how right it's done, a review is appreciated

@@ -11,6 +11,11 @@ module.exports = {
docsRepo: 'tachiyomiorg/website',
docsDir: 'src',
logo: '/assets/media/logo.svg',
algolia: {
apiKey: 'fc1c45b5a3835e1882cbbf0751dfe705',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be public?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's an alright key to be "public", it's implemented exactly according to their spec

}
}
handleLinksWrapWidth()
window.addEventListener('resize', handleLinksWrapWidth, false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also use https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia , which is more performant

Copy link
Member Author

@Soitora Soitora Apr 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how I'd add that, this file is just ejected VuePress file (required to change the import for AlgoliaSearchBox.vue), not something I wrote on my own, kind of how Home.vue is just an edited default file and not custom written

@Soitora Soitora changed the title [WIP] Switch to Algolia DocSearch Switch to Algolia DocSearch Apr 30, 2020
@Soitora Soitora merged commit 486f12a into tachiyomiorg:master Apr 30, 2020
@Soitora Soitora deleted the algolia-docsearch branch April 30, 2020 16:53
arkon pushed a commit that referenced this pull request Apr 30, 2020
* Add Algolia

* Overhaul the search

* Add sitemap.xml generator

* Remove SCSS files

* Eject components

* Algolia styling

* More styling x2 486f12a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add keywords such as 'Auto Backup' for search returns
3 participants