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

Join algolia's DocSearch program #962

Closed
keynmol opened this issue Nov 27, 2020 · 6 comments · Fixed by #963
Closed

Join algolia's DocSearch program #962

keynmol opened this issue Nov 27, 2020 · 6 comments · Fixed by #963

Comments

@keynmol
Copy link
Contributor

keynmol commented Nov 27, 2020

I think SBT's docs are great but underappreciated - a search bar with instant response can go a long way in helping that.

I know that scala-lang.org is using https://docsearch.algolia.com/ (a free search program for significant open source projects). The PR to add it in is small: https://github.com/scala/docs.scala-lang/pull/1096/files

Creating this issue just to track, there are some actions:

  1. A maintainer to request Algolia API key
  2. Me to create a PR with HTML necessary for algolia to work

How does this sound?

@eed3si9n
Copy link
Member

@keynmol Sounds awesome.

@SethTisue
Copy link
Member

SethTisue commented Nov 27, 2020

I would use this often. currently I git clone and git grep this repo to find stuff (and I do that several times a week, minimum)

@keynmol
Copy link
Contributor Author

keynmol commented Nov 27, 2020

I'm making good progress - apparently just stealing the code from scala-lang allows me to see some search results while I work on the rendering.

@eed3si9n is there a way to make makeSite snappier while losing some pages may be? I mostly work on the layouts and templates and it takes a minute to render all the docs, which at this point I don't need

@eed3si9n
Copy link
Member

@keynmol If you care only about front pages you can turn off Pamflet as follows:

diff --git a/build.sbt b/build.sbt
index dd921bd5..8ad5c0f5 100644
--- a/build.sbt
+++ b/build.sbt
@@ -9,8 +9,9 @@ ThisBuild / scalafmtOnCompile := true

 lazy val root = (project in file("."))
   .enablePlugins(
-    (if (!isBetaBranch) Seq(ParadoxSitePlugin) else Seq()) ++
-      Seq(LowTechSnippetPamfletPlugin, ScriptedPlugin): _*
+    ParadoxSitePlugin, ScriptedPlugin
+    // (if (!isBetaBranch) Seq(ParadoxSitePlugin) else Seq()) ++
+    //   Seq(LowTechSnippetPamfletPlugin, ScriptedPlugin): _*
   )
   .settings(
     name := "website",
@@ -44,10 +45,10 @@ lazy val root = (project in file("."))
     SiteHelpers.addMappingsToSiteDir(mappings in RedirectTutorial, tutorialSubDirName),
     // GitHub Pages. See project/Docs.scala
     customGhPagesSettings,
-    mappings in Pamflet := {
-      val xs = (mappings in Pamflet).value
-      Pdf.cleanupCombinedPages(xs) ++ xs
-    },
+    // mappings in Pamflet := {
+    //   val xs = (mappings in Pamflet).value
+    //   Pdf.cleanupCombinedPages(xs) ++ xs
+    // },
     if (scala.sys.BooleanProp.keyExists("sbt.website.generate_pdf"))
       Def settings (
         // NOTE - PDF settings must be done externally like this because pdf generation generically looks

@keynmol keynmol mentioned this issue Nov 28, 2020
3 tasks
@keynmol
Copy link
Contributor Author

keynmol commented Nov 28, 2020

@eed3si9n this worked for landing pages but once I realised that layout is completely different in the docs I had to revert that.

I've added a provisional PR with Algolia's default theme, and I hope we can iterate from there

@keynmol
Copy link
Contributor Author

keynmol commented Dec 3, 2020

For anyone following the issue and not the PR - progress is happening :)

Just a couple of optional tweaks to Algolia configuration and we should be in a good place.

image

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 a pull request may close this issue.

3 participants