Skip to content

Commit c3f4dcb

Browse files
committed
remove hardcoded TOC links from index files but leave other content
1 parent 8bb84de commit c3f4dcb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

script/content-migrations/update-tocs.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ indexFiles
7272
]
7373
}
7474

75+
// Remove the Table of Contents section and leave any custom content before it.
76+
const newContent = content.replace(/^#*? Table of contents[\s\S]*/im, '')
77+
7578
// Index files should no longer have body content, so we write an empty string
76-
fs.writeFileSync(indexFile, frontmatter.stringify(content, data, { lineWidth: 10000 }))
79+
fs.writeFileSync(indexFile, frontmatter.stringify(newContent, data, { lineWidth: 10000 }))
7780
})
7881

7982
function getLinks (linkItemArray) {

0 commit comments

Comments
 (0)