File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
scripts/documentation/open-graph Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -36,21 +36,30 @@ const targetFolder: string = resolve(
36
36
) ;
37
37
38
38
const data : { title : string ; content : string ; filename : string } [ ] = [ ] ;
39
- documents . map ( ( category ) => {
39
+ documents . forEach ( ( category ) => {
40
40
data . push ( {
41
41
title : category . name ,
42
42
content : category . description ,
43
43
filename : [ category . sidebarId , category . id ] . filter ( Boolean ) . join ( '-' ) ,
44
44
} ) ;
45
- category . itemList . map ( ( item ) =>
45
+ category . itemList . forEach ( ( item ) => {
46
46
data . push ( {
47
47
title : item . name ,
48
- content : category . name ,
48
+ content : item . description || category . name ,
49
49
filename : [ category . sidebarId , category . id , item . id ]
50
50
. filter ( Boolean )
51
51
. join ( '-' ) ,
52
- } )
53
- ) ;
52
+ } ) ;
53
+ item . itemList ?. forEach ( ( subItem ) => {
54
+ data . push ( {
55
+ title : subItem . name ,
56
+ content : subItem . description || category . name ,
57
+ filename : [ category . sidebarId , category . id , item . id , subItem . id ]
58
+ . filter ( Boolean )
59
+ . join ( '-' ) ,
60
+ } ) ;
61
+ } ) ;
62
+ } ) ;
54
63
} ) ;
55
64
packages . map ( ( pkg ) => {
56
65
data . push ( {
@@ -137,7 +146,7 @@ function splitLines(
137
146
if ( words . length <= 1 ) {
138
147
return words ;
139
148
}
140
- const lines = [ ] ;
149
+ const lines : string [ ] = [ ] ;
141
150
let currentLine = words [ 0 ] ;
142
151
143
152
for ( let i = 1 ; i < words . length ; i ++ ) {
You can’t perform that action at this time.
0 commit comments