From b204964e57f5590ec8d600af5637dd58d6d5c41d Mon Sep 17 00:00:00 2001 From: perf3ct Date: Wed, 3 Sep 2025 21:33:52 +0000 Subject: [PATCH] feat(docs): also update the Home.md --- .github/scripts/sync-docs-to-wiki.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/scripts/sync-docs-to-wiki.ts b/.github/scripts/sync-docs-to-wiki.ts index e54d0317d..e7b75d234 100755 --- a/.github/scripts/sync-docs-to-wiki.ts +++ b/.github/scripts/sync-docs-to-wiki.ts @@ -275,6 +275,23 @@ async function hasChanges(wikiDir: string): Promise { } } +/** + * Copy root README.md to wiki as Home.md if it exists + */ +async function copyRootReadme(mainRepoPath: string, wikiPath: string): Promise { + const rootReadmePath = path.join(mainRepoPath, 'README.md'); + const wikiHomePath = path.join(wikiPath, 'Home.md'); + + try { + await fs.access(rootReadmePath); + await fs.copyFile(rootReadmePath, wikiHomePath); + console.log(' Copied root README.md as Home.md'); + } catch (error) { + // Root README doesn't exist or can't be accessed + console.log(' No root README.md found to use as Home page'); + } +} + /** * Get configuration from environment variables */ @@ -304,6 +321,9 @@ async function syncDocsToWiki(): Promise { // Sync files (copy new/updated, remove orphaned) await syncFiles(config.docsPath, config.wikiPath); + // Copy root README.md as Home.md + await copyRootReadme(config.mainRepoPath, config.wikiPath); + // Rename README files to wiki-compatible names await renameReadmeFiles(config.wikiPath);