in tools/cleaner.ts [257:279]
export function dumpTopics(): AllTopicTypes {
/* Utility function to get a content migration spreadsheet of topics */
const allTopicTypes: AllTopicTypes = {};
guideSites.forEach((site) => {
allTopicTypes[site] = {
product: [],
technology: [],
topic: [],
};
const topics = path.normalize(`${__dirname}/../sites/${site}/topics`);
const resourceFiles = getAllFiles(topics, []);
const markdownResources = parseFrontmatter(resourceFiles);
Object.entries(markdownResources).forEach(([filePath, markdown]) => {
const label = filePath.split(path.sep)[10];
if (label !== "index.md") {
const topicType = markdown.frontmatter.topicType;
const key = topicType ? topicType : "topic";
allTopicTypes[site][key].push(label);
}
});
});
return allTopicTypes;
}