From faa9190d1cc1a55d077a375e4178d5cff47bc005 Mon Sep 17 00:00:00 2001 From: Taras Postument Date: Fri, 1 Nov 2024 14:01:16 +0000 Subject: [PATCH] a bit drier config code --- docusaurus.config.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index f3c0c51..5f67a14 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -27,18 +27,12 @@ const latestVersion = getLatestVersion(); const config: Config = { customFields: { inkeepConfig: (() => { - var config = { - apiKey: process.env.INKEEP_API_KEY, - integrationId: process.env.INKEEP_INTEGRATION_ID, - organizationId: process.env.INKEEP_ORGANIZATION_ID, + const configVars = process.env.secrets ? JSON.parse(process.env.secrets) : process.env; + return { + apiKey: configVars.INKEEP_API_KEY, + integrationId: configVars.INKEEP_INTEGRATION_ID, + organizationId: configVars.INKEEP_ORGANIZATION_ID, } - if (process.env.secrets) { - const secretJson = JSON.parse(process.env.secrets); - config.apiKey = secretJson.INKEEP_API_KEY; - config.integrationId = secretJson.INKEEP_INTEGRATION_ID; - config.organizationId = secretJson.INKEEP_ORGANIZATION_ID; - } - return config })(), }, clientModules: [