diff --git a/website/.gitignore b/website/.gitignore index b2d6de30..4815dbf1 100644 --- a/website/.gitignore +++ b/website/.gitignore @@ -18,3 +18,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +# Put all the algolia stuff in here +.env diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 3df217be..d5f28608 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -4,6 +4,13 @@ const lightCodeTheme = require('prism-react-renderer/themes/github') const darkCodeTheme = require('prism-react-renderer/themes/dracula') +// Load from .env during local development +try { + const dotenv = require('dotenv') + + dotenv.config() +} catch (e) {} + /** @type {import('@docusaurus/types').Config} */ const config = { title: 'Blink', @@ -123,6 +130,11 @@ const config = { prism: { theme: lightCodeTheme, darkTheme: darkCodeTheme + }, + algolia: { + appId: process.env.ALGOLIA_APP_ID, + apiKey: process.env.ALGOLIA_API_KEY, // look for "Search API Key" + indexName: 'blink' } }) } diff --git a/website/package-lock.json b/website/package-lock.json index 047e9b45..b98ebca0 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -1,11 +1,11 @@ { - "name": "website-2", + "name": "blink-docs", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "website-2", + "name": "blink-docs", "version": "0.0.0", "dependencies": { "@docusaurus/core": "2.4.0", @@ -19,6 +19,7 @@ "devDependencies": { "@docusaurus/module-type-aliases": "2.4.0", "@tsconfig/docusaurus": "^1.0.5", + "dotenv": "^16.0.3", "typescript": "^4.7.4" }, "engines": { @@ -5521,6 +5522,15 @@ "node": ">=8" } }, + "node_modules/dotenv": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", diff --git a/website/package.json b/website/package.json index e6407ce4..10314eab 100644 --- a/website/package.json +++ b/website/package.json @@ -1,5 +1,5 @@ { - "name": "website-2", + "name": "blink-docs", "version": "0.0.0", "private": true, "scripts": { @@ -26,6 +26,7 @@ "devDependencies": { "@docusaurus/module-type-aliases": "2.4.0", "@tsconfig/docusaurus": "^1.0.5", + "dotenv": "^16.0.3", "typescript": "^4.7.4" }, "browserslist": {