feat(docs): Add integration for downloading and incorporating readme documents from external domains

This commit is contained in:
2025-01-25 01:17:17 +01:00
parent 49573c41c9
commit 7fb30a6209
22 changed files with 3719 additions and 1 deletions

View File

@ -29,6 +29,12 @@ export default async () => {
plugins.path.join(paths.docsDir, 'push.rocks'),
);
await helpers.downloadReadmes(
'https://code.foss.global',
'serve.zone',
plugins.path.join(paths.docsDir, 'serve.zone'),
);
return plugins.vitepress.defineConfig({
lang: 'en-US',

View File

@ -139,6 +139,7 @@ export async function downloadReadmes(
let readmeContent = atob(readmeContentResponseObject.content);
readmeContent = `---
title: "@${org}/${repo.name}"
source: "gitea"
---
${readmeContent}`;
const sanitizedRepoName = repoName.replace(/[^a-z0-9_\-]/gi, '_'); // Sanitize filename