@@ -160,32 +160,6 @@ const createReactToc = (version) => {
160
160
fs . writeFileSync ( TARGET_FILE , JSON . stringify ( toc ) , "utf8" ) ;
161
161
} ;
162
162
163
- const createCommunityToc = ( ) => {
164
- const MD_DIR = path . join ( __dirname , "../pages/community" ) ;
165
- // Skip Community TOC generation if the community directory doesn't exist. This avoids build-time
166
- // errors when the community section has been removed or hasn't been migrated yet.
167
- if ( ! fs . existsSync ( MD_DIR ) ) {
168
- console . warn ( `Skipping Community TOC generation: Directory not found -> ${ MD_DIR } ` ) ;
169
- return ;
170
- }
171
- const SIDEBAR_JSON = path . join ( __dirname , "../data/sidebar_community.json" ) ;
172
- const TARGET_FILE = path . join ( __dirname , "../index_data/community_toc.json" ) ;
173
-
174
- const sidebarJson = JSON . parse ( fs . readFileSync ( SIDEBAR_JSON ) ) ;
175
-
176
- const FILE_ORDER = Object . values ( sidebarJson ) . reduce ( ( acc , items ) => {
177
- return acc . concat ( items ) ;
178
- } , [ ] ) ;
179
-
180
- const files = glob . sync ( `${ MD_DIR } /*.?(js|md?(x))` ) ;
181
- const ordered = orderFiles ( files , FILE_ORDER ) ;
182
-
183
- const result = ordered . map ( ( filepath ) => processFile ( filepath , sidebarJson ) ) ;
184
- const toc = createTOC ( result ) ;
185
-
186
- fs . writeFileSync ( TARGET_FILE , JSON . stringify ( toc ) , "utf8" ) ;
187
- } ;
188
-
189
163
/*
190
164
const debugToc = () => {
191
165
const MD_DIR = path.join(__dirname, "../pages/docs/manual/latest");
@@ -206,4 +180,3 @@ let reactManualVersions = ["latest", "v0.10.0", "v0.11.0"];
206
180
207
181
manualVersions . forEach ( createManualToc ) ;
208
182
reactManualVersions . forEach ( createReactToc ) ;
209
- createCommunityToc ( ) ;
0 commit comments