File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,21 @@ const main_template_jira_scripts = () => {
19
19
}
20
20
}
21
21
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
+
26
37
27
38
/** @type {import('@docusaurus/types').Config } */
28
39
const config = {
You can’t perform that action at this time.
0 commit comments