diff --git a/packages/palette-docs/gatsby-config.js b/packages/palette-docs/gatsby-config.js
index 4025c482b..956994ce5 100644
--- a/packages/palette-docs/gatsby-config.js
+++ b/packages/palette-docs/gatsby-config.js
@@ -78,14 +78,11 @@ module.exports = {
"gatsby-plugin-typescript",
"gatsby-plugin-sitemap",
{
- // Currently this plugin is only being used to hook up the script & css, so the options don't matter a whole lot.
- // We could probably just implement the few bits that work for our scenario instead.
- resolve: `gatsby-plugin-algolia-docsearch`, //require.resolve("./gatsby-algolia-search.js"),
+ resolve: "gatsby-plugin-local-algolia-docsearch",
options: {
- apiKey: "it-doesnt-matter-not-using-it", // required
- indexName: "it-doesnt-matter-not-using-it", // required
- inputSelector: ".it-doesnt-matter-not-using-it", // required
- debug: true, // (bool)Optional. Default `false`
+ apiKey: "e4ea4437446d07b0549e0db7928d92d1",
+ indexName: "artsy_palette",
+ debug: false,
},
},
],
diff --git a/packages/palette-docs/gatsby-ssr.js b/packages/palette-docs/gatsby-ssr.js
index 781100420..331d84fbd 100644
--- a/packages/palette-docs/gatsby-ssr.js
+++ b/packages/palette-docs/gatsby-ssr.js
@@ -1,5 +1,4 @@
// @ts-check
-import React from "react"
/**
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
@@ -9,19 +8,3 @@ import React from "react"
import { Boot } from "./src/Boot"
export const wrapRootElement = Boot
-
-export function onRenderBody(
- { setHeadComponents, setPostBodyComponents },
- { apiKey, indexName, inputSelector, debug = false }
-) {
- setPostBodyComponents([
- ,
- ])
-}
diff --git a/packages/palette-docs/package.json b/packages/palette-docs/package.json
index 92d6fb8cd..2d6f9735c 100644
--- a/packages/palette-docs/package.json
+++ b/packages/palette-docs/package.json
@@ -80,7 +80,6 @@
"gatsby": "2.3.34",
"gatsby-image": "^2.0.20",
"gatsby-mdx": "^0.3.4",
- "gatsby-plugin-algolia-docsearch": "^1.0.5",
"gatsby-plugin-catch-links": "^2.0.10",
"gatsby-plugin-force-trailing-slashes": "^1.0.4",
"gatsby-plugin-manifest": "^2.0.9",
diff --git a/packages/palette-docs/plugins/gatsby-plugin-local-algolia-docsearch/gatsby-ssr.js b/packages/palette-docs/plugins/gatsby-plugin-local-algolia-docsearch/gatsby-ssr.js
new file mode 100644
index 000000000..2c4530007
--- /dev/null
+++ b/packages/palette-docs/plugins/gatsby-plugin-local-algolia-docsearch/gatsby-ssr.js
@@ -0,0 +1,30 @@
+const React = require("react")
+
+exports.onRenderBody = (
+ { setHeadComponents, setPostBodyComponents },
+ { apiKey, indexName, debug = false }
+) => {
+ setHeadComponents([
+ ,
+ ])
+
+ setPostBodyComponents([
+ ,
+ ,
+ ])
+}
diff --git a/packages/palette-docs/plugins/gatsby-plugin-local-algolia-docsearch/index.js b/packages/palette-docs/plugins/gatsby-plugin-local-algolia-docsearch/index.js
new file mode 100644
index 000000000..172f1ae6a
--- /dev/null
+++ b/packages/palette-docs/plugins/gatsby-plugin-local-algolia-docsearch/index.js
@@ -0,0 +1 @@
+// noop
diff --git a/packages/palette-docs/plugins/gatsby-plugin-local-algolia-docsearch/package.json b/packages/palette-docs/plugins/gatsby-plugin-local-algolia-docsearch/package.json
new file mode 100644
index 000000000..ad6cc6506
--- /dev/null
+++ b/packages/palette-docs/plugins/gatsby-plugin-local-algolia-docsearch/package.json
@@ -0,0 +1,3 @@
+{
+ "name": "gatsby-plugin-local-algolia-docsearch"
+}
diff --git a/packages/palette-docs/src/components/Sidebar/SearchBox.tsx b/packages/palette-docs/src/components/Sidebar/SearchBox.tsx
index 2ae2f0f78..e68feb66b 100644
--- a/packages/palette-docs/src/components/Sidebar/SearchBox.tsx
+++ b/packages/palette-docs/src/components/Sidebar/SearchBox.tsx
@@ -3,12 +3,15 @@ import React, { useEffect } from "react"
export function SearchBox() {
useEffect(() => {
+ if (window.docsearchSettings === undefined) {
+ return
+ }
console.log("doing the thing with ", window.docsearchSettings)
docsearch({
apiKey: window.docsearchSettings.apiKey,
indexName: window.docsearchSettings.indexName,
inputSelector: "#search",
- debug: "false",
+ debug: window.docsearchSettings.indexName,
})
}, [])
return
diff --git a/yarn.lock b/yarn.lock
index 17fe8d66b..2d2691c19 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -10719,13 +10719,6 @@ gatsby-mdx@^0.3.4:
unist-util-remove "^1.0.1"
unist-util-visit "^1.4.0"
-gatsby-plugin-algolia-docsearch@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/gatsby-plugin-algolia-docsearch/-/gatsby-plugin-algolia-docsearch-1.0.5.tgz#d6dea17deda8c8bf9ac8cd3e1fb8f6bf6591db01"
- integrity sha512-2oylL3ioy22Cu24zP8SpanK09SlP8i3p1j9CQ2rTXJgdNmsK2QhqymaLOGBvzGDMpPRn1qJszlNz/EUNAHafjg==
- dependencies:
- "@babel/runtime" "^7.0.0"
-
gatsby-plugin-catch-links@^2.0.10:
version "2.0.13"
resolved "https://registry.yarnpkg.com/gatsby-plugin-catch-links/-/gatsby-plugin-catch-links-2.0.13.tgz#b49bb1e2383881cffca86a428348a7afdb6c3dd4"