Skip to content

Commit 336a930

Browse files
committed
fix need for PROJECT_NAME
1 parent 27f8cec commit 336a930

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

documentation/docusaurus.config.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,21 @@ const main_template_jira_scripts = () => {
1919
}
2020
}
2121

22-
// You can change the title here. The default is the name of the repository.
23-
const title = ''+process.env.PROJECT_NAME.replaceAll('-',' ').split(' ').map((word) => {
24-
return word[0].toUpperCase() + word.substring(1);
25-
}).join(' ');
22+
// Fallback value if PROJECT_NAME is not defined:
23+
const rawProjectName = process.env.PROJECT_NAME || 'docs-dev-mode';
24+
25+
// Transform PROJECT_NAME (or fallback) to a title-like string:
26+
const title = rawProjectName
27+
.replaceAll('-', ' ')
28+
.split(' ')
29+
.map(word => {
30+
// Make sure the word has at least one character
31+
return word.length > 0
32+
? word[0].toUpperCase() + word.substring(1)
33+
: '';
34+
})
35+
.join(' ');
36+
2637

2738
/** @type {import('@docusaurus/types').Config} */
2839
const config = {

0 commit comments

Comments
 (0)