diff --git a/docs/plugins/changelog-plugin/fetchData.js b/docs/plugins/changelog-plugin/fetchData.js index dce30c147..351ab3932 100644 --- a/docs/plugins/changelog-plugin/fetchData.js +++ b/docs/plugins/changelog-plugin/fetchData.js @@ -6,14 +6,13 @@ async function fetchData(siteConfig) { const repo = siteConfig.projectName; const apiUrl = `https://api.github.com/repos/${owner}/${repo}/releases`; - const outputDirectory = path.join(__dirname, '../../docs/guides/changelogs'); + const outputDirectory = path.join(__dirname, '../../docs/releases/changelog'); if (!fs.existsSync(outputDirectory)) { fs.mkdirSync(outputDirectory); } let counter = 1; - const categoryFilePath = path.join(outputDirectory, '_category_.json'); const cacheFilePath = path.join(outputDirectory, 'cache.json'); let cachedData = {}; @@ -83,7 +82,7 @@ async function fetchData(siteConfig) { const changes = release.body; - let markdownContent = `---\nsidebar_position: ${counter}\n---\n# ${version}\n\nFor more details, [GitHub Issues](${releaseUrl})\n\nHighlighted Issue: ${issueLink}\n\n${changes}\n`; + let markdownContent = `---\nsidebar_position: ${counter}\nslug: /changelog/changelog-${version}\n---\n# ${version}\n\nFor more details, [GitHub Issues](${releaseUrl})\n\nHighlighted Issue: ${issueLink}\n\n${changes}\n`; // Write to a separate markdown file for each version const outputFilePath = path.join(outputDirectory, `changelog-${version}.mdx`); @@ -93,20 +92,6 @@ async function fetchData(siteConfig) { counter++; } - - // Create _category_.json file - const categoryContent = { - label: 'Changelogs', - position: 5, - link: { - type: 'generated-index', - description: 'Changelog for Jan', - }, - }; - - fs.writeFileSync(categoryFilePath, JSON.stringify(categoryContent, null, 2), 'utf-8'); - - console.log(`_category_.json has been created at: ${categoryFilePath}`); } -module.exports = fetchData; +module.exports = fetchData; \ No newline at end of file