From 7026d2d594d593b6d7efd991f2ba827c4a12e767 Mon Sep 17 00:00:00 2001 From: hieu-jan <150573299+hieu-jan@users.noreply.github.com> Date: Sun, 10 Mar 2024 18:19:19 +0900 Subject: [PATCH] feat: update changelog configuration --- docs/plugins/changelog-plugin/fetchData.js | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) 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