File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import "./about.scss";
9
9
10
10
export function CurriculumAbout ( props : HydrationData < any , CurriculumDoc > ) {
11
11
const doc = useCurriculumDoc ( props ) ;
12
+ // [["About"], ["the", "MDN", "Curriculum"]]
12
13
const [ coloredTitle , ...restTitle ] = doc ?. title ?. split ( " " ) || [ ] ;
13
14
return (
14
15
< CurriculumLayout
Original file line number Diff line number Diff line change @@ -12,15 +12,20 @@ export function CurriculumModuleOverview(
12
12
props : HydrationData < any , CurriculumDoc >
13
13
) {
14
14
const doc = useCurriculumDoc ( props as CurriculumData ) ;
15
- const [ coloredTitle , ...restTitle ] = doc ?. title ?. split ( " " ) || [ ] ;
15
+ // ["Getting", "started", "modules"]
16
+ const titleParts = doc ?. title ?. split ( " " ) || [ ] ;
17
+ // "Getting started"
18
+ const coloredTitle = titleParts . slice ( 0 , - 1 ) . join ( " " ) ;
19
+ // "modules"
20
+ const restTitle = titleParts . at ( - 1 ) ;
16
21
return (
17
22
< CurriculumLayout
18
23
doc = { doc }
19
24
extraClasses = { [ "curriculum-overview" , `topic-${ topic2css ( doc ?. topic ) } ` ] }
20
25
>
21
26
< header >
22
27
< h1 >
23
- < span > { coloredTitle } </ span > { restTitle . join ( " " ) }
28
+ < span > { coloredTitle } </ span > { restTitle }
24
29
</ h1 >
25
30
</ header >
26
31
< RenderCurriculumBody doc = { doc } />
You can’t perform that action at this time.
0 commit comments