@@ -160,32 +160,6 @@ const createReactToc = (version) => {
160160 fs . writeFileSync ( TARGET_FILE , JSON . stringify ( toc ) , "utf8" ) ;
161161} ;
162162
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-
189163/*
190164const debugToc = () => {
191165 const MD_DIR = path.join(__dirname, "../pages/docs/manual/latest");
@@ -206,4 +180,3 @@ let reactManualVersions = ["latest", "v0.10.0", "v0.11.0"];
206180
207181manualVersions . forEach ( createManualToc ) ;
208182reactManualVersions . forEach ( createReactToc ) ;
209- createCommunityToc ( ) ;
0 commit comments