@@ -38,13 +38,12 @@ indexFiles
3838 const documentType = getDocumentType ( relativePath )
3939
4040 const { data, content } = frontmatter ( fs . readFileSync ( indexFile , 'utf8' ) )
41- let newContent = content
4241
4342 if ( documentType === 'homepage' ) {
4443 data . children = sortedProductIds
4544 }
4645
47- const linkItems = newContent . match ( linksArray ) || [ ]
46+ const linkItems = content . match ( linksArray ) || [ ]
4847
4948 // Turn the `{% link /<link> %}` list into an array of /<link> items
5049 if ( documentType === 'product' || documentType === 'mapTopic' ) {
@@ -57,14 +56,6 @@ indexFiles
5756 data . children = childMapTopics . length ? getLinks ( childMapTopics ) : getLinks ( linkItems )
5857 }
5958
60- linkItems . forEach ( linkItem => {
61- newContent = newContent . replace ( linkItem , '' ) . trim ( )
62- } )
63-
64- newContent = newContent
65- . replace ( / # # # ? T a b l e o f C o n t e n t s \n / i, '' )
66- . replace ( / < ! - - { 2 } - - > \n / g, '' )
67-
6859 // Fix this one weird file
6960 if ( relativePath === 'discussions/guides/index.md' ) {
7061 data . children = [
@@ -74,7 +65,8 @@ indexFiles
7465 ]
7566 }
7667
77- fs . writeFileSync ( indexFile , frontmatter . stringify ( newContent . trim ( ) , data , { lineWidth : 10000 } ) )
68+ // Index files should no longer have body content, so we write an empty string
69+ fs . writeFileSync ( indexFile , frontmatter . stringify ( '' , data , { lineWidth : 10000 } ) )
7870 } )
7971
8072function getLinks ( linkItemArray ) {
0 commit comments