Skip to content

Commit

Permalink
feat: add dotenv support for managing environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mimisavage committed Dec 16, 2024
1 parent 6792c3b commit f77fe00
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
APP_ID=
API_KEY=
INDEX_NAME=
9 changes: 6 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const dotenv = require('dotenv'); // Import dotenv
dotenv.config(); // Load environment variables

const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");

Expand Down Expand Up @@ -130,9 +133,9 @@ const config = {
darkTheme: darkCodeTheme,
},
algolia: {
appId: "OQHBL9CWH9",
apiKey: "042138591ea150790b1f40a365755caf",
indexName: "scaffoldstark",
appId: process.env.APP_ID,
apiKey: process.env.API_KEY,
indexName: process.env.INDEX_NAME,
contextualSearch: true,
externalUrlRegex: "external\\.com|domain\\.com",
replaceSearchResultPathname: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@docusaurus/preset-classic": "2.4.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"dotenv": "^16.4.7",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
Expand Down

0 comments on commit f77fe00

Please sign in to comment.