Skip to content

Commit d5939a1

Browse files
Differentiate same name config files
Signed-off-by: Vipul Gupta (@vipulgupta2048) <[email protected]>
1 parent 16a29b0 commit d5939a1

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

.cspell/balena-words.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ balena-builder
77
balenacli
88
balenahup
99
balenalib
10-
balenasdk
11-
balenasdkpython
1210
balenista
1311
balenistas
1412
Barys
@@ -30,8 +28,10 @@ metalsmith
3028
model
3129
multicontainer
3230
Nicky
31+
nodesdk
3332
openbalena
3433
private-contracts
34+
pythonsdk
3535
resinio
3636
Rulemotion
3737
SBVR

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ config/dictionaries/balenacli.json
4747
shared/balena-cli-versions/
4848

4949
# Ignore dynamic balena-SDK version docs
50-
config/dictionaries/balenasdk.json
50+
config/dictionaries/nodesdk.json
5151
shared/balena-sdk-versions/
5252

5353
# Ignore dynamic Python SDK version docs
54-
config/dictionaries/balenasdkpython.json
54+
config/dictionaries/pythonsdk.json
5555
shared/balena-sdk-python-versions/
5656

5757
# Ignore dynamic assets generated for Getting Started

config/navigation.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ Reference
151151

152152
CLI[/reference/balena-cli/$balenacli]
153153
SDKs
154-
Node.js SDK[/reference/sdk/node-sdk/$balenasdk]
155-
Python SDK[/reference/sdk/python-sdk/$balenasdkpython]
154+
Node.js SDK[/reference/sdk/node-sdk/$nodesdk]
155+
Python SDK[/reference/sdk/python-sdk/$pythonsdk]
156156
Deprecation Policy[/reference/sdk/deprecation-policy]
157157

158158
Diagnostics

pages/reference/sdk/node-sdk.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: balena Node.js SDK Documentation
44
layout: balena-sdk.html
55

66
dynamic:
7-
variables: [ $balenasdk ]
8-
ref: $original_ref/$balenasdk
9-
$switch_text: balena SDK version $balenasdk
7+
variables: [ $nodesdk ]
8+
ref: $original_ref/$nodesdk
9+
$switch_text: balena SDK version $nodesdk
1010
---
1111

12-
# Balena Node.js SDK {{ $balenasdk.version }} Documentation
12+
# Balena Node.js SDK {{ $nodesdk.version }} Documentation
1313

1414
{{import "balena-sdk-versions"}}

pages/reference/sdk/python-sdk.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: balena Python SDK Documentation
44
layout: balena-sdk-python.html
55

66
dynamic:
7-
variables: [ $balenasdkpython ]
8-
ref: $original_ref/$balenasdkpython
9-
$switch_text: balena SDK version $balenasdkpython
7+
variables: [ $pythonsdk ]
8+
ref: $original_ref/$pythonsdk
9+
$switch_text: balena SDK version $pythonsdk
1010
---
1111

12-
# Balena Python SDK {{ $balenasdkpython.version }} Documentation
12+
# Balena Python SDK {{ $pythonsdk.version }} Documentation
1313

1414
{{import "balena-sdk-python-versions"}}

tools/versioning.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,20 @@ async function main() {
251251
process.exit(1);
252252
}
253253

254+
const versionsConfigFileTemplate = {
255+
"balenasdk": "nodesdk",
256+
"balenasdkpython": "pythonsdk",
257+
}
258+
254259
// Parse repository details
255260
const { owner, name: repoName, filepath } = parseGithubUrl(repoUrl);
256-
const versionsConfigFile = `./config/dictionaries/${repoName.replaceAll(/-/g, "")}.json`
261+
262+
// Create versioned config file - Doxx doesn't allow dashes in the config file name
263+
const versionsFileName = repoName.replaceAll(/-/g, "")
264+
// Doxx treats config files with common names as same, so balenasdk and balenasdkpython config files needs to be named differently
265+
const versionsConfigFile = versionsConfigFileTemplate[versionsFileName] ? versionsConfigFileTemplate[versionsFileName] : versionsFileName
266+
const versionsConfigFilePath = `./config/dictionaries/${versionsConfigFile}.json`
267+
257268
const versionedDocsFolder = path.join(__dirname, `../shared/${repoName}-versions`)
258269

259270
console.log(`Started versioning ${repoName} docs`)
@@ -263,7 +274,7 @@ async function main() {
263274
const tagVersions = await fetchGitHubTags(owner, repoName);
264275

265276
// Write versions configuration
266-
await fsPromises.writeFile(versionsConfigFile, JSON.stringify(tagVersions, null, 2));
277+
await fsPromises.writeFile(versionsConfigFilePath, JSON.stringify(tagVersions, null, 2));
267278
if (fs.existsSync(versionedDocsFolder)) {
268279
await fsPromises.rm(versionedDocsFolder, { recursive: true });
269280
}

0 commit comments

Comments
 (0)