feat: add discovery files sync commands and update documentation

This commit is contained in:
Wayne Sutton
2025-12-24 23:16:34 -08:00
parent 1ac6b9fc84
commit 03ff3eb844
28 changed files with 2345 additions and 81 deletions

View File

@@ -39,6 +39,13 @@ interface ForkConfig {
github: string;
};
bio: string;
// New gitHubRepoConfig for AI service raw URLs
gitHubRepoConfig?: {
owner: string;
repo: string;
branch: string;
contentPath: string;
};
logoGallery?: {
enabled: boolean;
title: string;
@@ -245,6 +252,33 @@ function updateSiteConfig(config: ForkConfig): void {
);
}
// Update gitHubRepo config (for AI service raw URLs)
// Support both new gitHubRepoConfig and legacy githubUsername/githubRepo fields
const gitHubRepoOwner =
config.gitHubRepoConfig?.owner || config.githubUsername;
const gitHubRepoName =
config.gitHubRepoConfig?.repo || config.githubRepo;
const gitHubRepoBranch = config.gitHubRepoConfig?.branch || "main";
const gitHubRepoContentPath =
config.gitHubRepoConfig?.contentPath || "public/raw";
content = content.replace(
/owner: ['"].*?['"],\s*\/\/ GitHub username or organization/,
`owner: "${gitHubRepoOwner}", // GitHub username or organization`,
);
content = content.replace(
/repo: ['"].*?['"],\s*\/\/ Repository name/,
`repo: "${gitHubRepoName}", // Repository name`,
);
content = content.replace(
/branch: ['"].*?['"],\s*\/\/ Default branch/,
`branch: "${gitHubRepoBranch}", // Default branch`,
);
content = content.replace(
/contentPath: ['"].*?['"],\s*\/\/ Path to raw markdown files/,
`contentPath: "${gitHubRepoContentPath}", // Path to raw markdown files`,
);
fs.writeFileSync(filePath, content, "utf-8");
console.log(` Updated: src/config/siteConfig.ts`);
}