Skip to content

Commit

Permalink
Enviroment var patch
Browse files Browse the repository at this point in the history
  • Loading branch information
AE-0h committed Dec 5, 2024
1 parent 59a6c64 commit 0658d7e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 31 deletions.
2 changes: 0 additions & 2 deletions .env.example

This file was deleted.

4 changes: 3 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// See: https://docusaurus.io/docs/api/docusaurus-config

import 'dotenv/config';
import dotenv from 'dotenv';
dotenv.config();

import {themes as prismThemes} from 'prism-react-renderer';
import {createNavItems} from './src/_utils/utils.js';
Expand All @@ -27,7 +29,7 @@ const config = {
customFields: {
keys : {
mendable : process.env.MENDABLE_KEY,
cookbook: process.env.COOKBOOK_PUBLIC_API_KEY,
cookbook : process.env.COOKBOOK_PUBLIC_API_KEY,
},
homePage: {
editUrl: 'https://github.com/rsksmart/devportal/tree/main/',
Expand Down
17 changes: 0 additions & 17 deletions index.js

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@
"last 3 firefox version",
"last 5 safari version"
]
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
17 changes: 7 additions & 10 deletions src/theme/Navbar/AskCookbook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
const BaseAskCookbook = React.lazy(() =>
import("@cookbookdev/docsbot/react-fixed")
);

const {
siteConfig: {customFields},
} = useDocusaurusContext();
const {keys} = customFields;

const CookbookPubKey = keys.cookbook;

export default function AskCookbook() {
export default function AskCookbook() {
const {
siteConfig: {customFields},
} = useDocusaurusContext();
const {keys} = customFields;
const COOKBOOK_PUBLIC_API_KEY = keys.cookbook;
return (
<BrowserOnly>
{() => (
<Suspense>
<BaseAskCookbook apiKey={CookbookPubKey} />
<BaseAskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} />
</Suspense>
)}
</BrowserOnly>
Expand Down

0 comments on commit 0658d7e

Please sign in to comment.