feat(docs): also update the Home.md

This commit is contained in:
perf3ct 2025-09-03 21:33:52 +00:00
parent b2c869d7ab
commit b204964e57
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232

View File

@ -275,6 +275,23 @@ async function hasChanges(wikiDir: string): Promise<boolean> {
}
}
/**
* Copy root README.md to wiki as Home.md if it exists
*/
async function copyRootReadme(mainRepoPath: string, wikiPath: string): Promise<void> {
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<void> {
// 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);