Merge pull request 'Add support for ENV variables' (#27) from parameter_config_with_env into main

Reviewed-on: D-Net/openaire-graph-docs#27
This commit is contained in:
Serafeim Chatzopoulos 2022-12-16 17:56:07 +01:00
commit e3126ec32d
4 changed files with 29 additions and 2 deletions

2
.env Normal file
View File

@ -0,0 +1,2 @@
URL="http://snf-23385.ok-kno.grnetcloud.net"
BASE_URL="/"

View File

@ -5,13 +5,23 @@ const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const math = require('remark-math');
const katex = require('rehype-katex');
const dotenv = require('dotenv');
// load env variables (see .env file)
const env = dotenv.config();
if (env.error) {
throw env.error;
}
console.info("ENV VARIABLES:");
console.info(env.parsed);
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'OpenAIRE Research Graph Documentation',
tagline: 'Open Access Infrastructure for Research in Europe',
url: 'http://snf-23385.ok-kno.grnetcloud.net',
baseUrl: '/', // serve the website at route
url: process.env.URL,
baseUrl: process.env.BASE_URL, // serve the website at route
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',

14
package-lock.json generated
View File

@ -12,6 +12,7 @@
"@docusaurus/preset-classic": "^2.2.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"dotenv": "^16.0.3",
"hast-util-is-element": "^1.1.0",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
@ -5422,6 +5423,14 @@
"node": ">=8"
}
},
"node_modules/dotenv": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
"engines": {
"node": ">=12"
}
},
"node_modules/duplexer": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
@ -16363,6 +16372,11 @@
}
}
},
"dotenv": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
},
"duplexer": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",

View File

@ -18,6 +18,7 @@
"@docusaurus/preset-classic": "^2.2.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"dotenv": "^16.0.3",
"hast-util-is-element": "^1.1.0",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",