diff --git a/.cspell/balena-words.txt b/.cspell/balena-words.txt index 6ac414256..ee5bef0b6 100644 --- a/.cspell/balena-words.txt +++ b/.cspell/balena-words.txt @@ -7,8 +7,6 @@ balena-builder balenacli balenahup balenalib -balenasdk -balenasdkpython balenista balenistas Barys @@ -30,8 +28,10 @@ metalsmith model multicontainer Nicky +nodesdk openbalena private-contracts +pythonsdk resinio Rulemotion SBVR diff --git a/.gitignore b/.gitignore index 641c7a7ca..de40e8df4 100644 --- a/.gitignore +++ b/.gitignore @@ -47,11 +47,11 @@ config/dictionaries/balenacli.json shared/balena-cli-versions/ # Ignore dynamic balena-SDK version docs -config/dictionaries/balenasdk.json +config/dictionaries/nodesdk.json shared/balena-sdk-versions/ # Ignore dynamic Python SDK version docs -config/dictionaries/balenasdkpython.json +config/dictionaries/pythonsdk.json shared/balena-sdk-python-versions/ # Ignore dynamic assets generated for Getting Started diff --git a/config/navigation.txt b/config/navigation.txt index be4ca64a0..fb492cc2e 100644 --- a/config/navigation.txt +++ b/config/navigation.txt @@ -151,8 +151,8 @@ Reference CLI[/reference/balena-cli/$balenacli] SDKs - Node.js SDK[/reference/sdk/node-sdk/$balenasdk] - Python SDK[/reference/sdk/python-sdk/$balenasdkpython] + Node.js SDK[/reference/sdk/node-sdk/$nodesdk] + Python SDK[/reference/sdk/python-sdk/$pythonsdk] Deprecation Policy[/reference/sdk/deprecation-policy] Diagnostics diff --git a/pages/reference/sdk/node-sdk.md b/pages/reference/sdk/node-sdk.md index f7e779a5f..f76a10585 100644 --- a/pages/reference/sdk/node-sdk.md +++ b/pages/reference/sdk/node-sdk.md @@ -4,11 +4,11 @@ title: balena Node.js SDK Documentation layout: balena-sdk.html dynamic: - variables: [ $balenasdk ] - ref: $original_ref/$balenasdk - $switch_text: balena SDK version $balenasdk + variables: [ $nodesdk ] + ref: $original_ref/$nodesdk + $switch_text: balena SDK version $nodesdk --- -# Balena Node.js SDK {{ $balenasdk.version }} Documentation +# Balena Node.js SDK {{ $nodesdk.version }} Documentation {{import "balena-sdk-versions"}} diff --git a/pages/reference/sdk/python-sdk.md b/pages/reference/sdk/python-sdk.md index a77c4fd4d..3d89e4f9b 100644 --- a/pages/reference/sdk/python-sdk.md +++ b/pages/reference/sdk/python-sdk.md @@ -4,11 +4,11 @@ title: balena Python SDK Documentation layout: balena-sdk-python.html dynamic: - variables: [ $balenasdkpython ] - ref: $original_ref/$balenasdkpython - $switch_text: balena SDK version $balenasdkpython + variables: [ $pythonsdk ] + ref: $original_ref/$pythonsdk + $switch_text: balena SDK version $pythonsdk --- -# Balena Python SDK {{ $balenasdkpython.version }} Documentation +# Balena Python SDK {{ $pythonsdk.version }} Documentation {{import "balena-sdk-python-versions"}} diff --git a/tools/versioning.js b/tools/versioning.js index 1bb875471..0590734cb 100644 --- a/tools/versioning.js +++ b/tools/versioning.js @@ -251,9 +251,20 @@ async function main() { process.exit(1); } + const versionsConfigFileTemplate = { + "balenasdk": "nodesdk", + "balenasdkpython": "pythonsdk", + } + // Parse repository details const { owner, name: repoName, filepath } = parseGithubUrl(repoUrl); - const versionsConfigFile = `./config/dictionaries/${repoName.replaceAll(/-/g, "")}.json` + + // Create versioned config file - Doxx doesn't allow dashes in the config file name + const versionsFileName = repoName.replaceAll(/-/g, "") + // Doxx treats config files with common names as same, so balenasdk and balenasdkpython config files needs to be named differently + const versionsConfigFile = versionsConfigFileTemplate[versionsFileName] ? versionsConfigFileTemplate[versionsFileName] : versionsFileName + const versionsConfigFilePath = `./config/dictionaries/${versionsConfigFile}.json` + const versionedDocsFolder = path.join(__dirname, `../shared/${repoName}-versions`) console.log(`Started versioning ${repoName} docs`) @@ -263,7 +274,7 @@ async function main() { const tagVersions = await fetchGitHubTags(owner, repoName); // Write versions configuration - await fsPromises.writeFile(versionsConfigFile, JSON.stringify(tagVersions, null, 2)); + await fsPromises.writeFile(versionsConfigFilePath, JSON.stringify(tagVersions, null, 2)); if (fs.existsSync(versionedDocsFolder)) { await fsPromises.rm(versionedDocsFolder, { recursive: true }); }