Skip to content

Commit

Permalink
fix: ensure copy dest dir exist
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolee1231 committed Dec 21, 2023
1 parent cdd8004 commit 58f2ec7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import {
existsSync,
cpSync,
readdirSync,
stat,
statSync,
copyFile,
copyFileSync,
readFileSync,
writeFileSync,
mkdirSync,
} from 'node:fs';
import { simpleGit } from 'simple-git';

Expand All @@ -30,6 +29,11 @@ const sources = ['blog', 'rfcs'];
const dests = ['zh', 'en'];

const copyDir = (source: string, dest: string) => {
if (!existsSync(dest)) {
mkdirSync(dest, {
recursive: true,
});
}
const files = readdirSync(source);
for (const filename of files) {
const file = statSync(join(source, filename));
Expand All @@ -47,7 +51,10 @@ const copyDir = (source: string, dest: string) => {

const filesource = readFileSync(join(source, filename), 'utf-8');
const newfile = filesource.replaceAll('(../public', '(../../public');
writeFileSync(join(dest, filename), newfile, 'utf-8');

writeFileSync(join(dest, filename), newfile, {
encoding: 'utf-8',
});
}
};

Expand Down
28 changes: 28 additions & 0 deletions src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: 'MetaGPT'
text: 'The Multi-Agent Framework'
tagline: Assign different roles to GPTs to form a collaborative software entity for complex tasks.
image:
light: /logo-dark.svg
dark: /logo-light.svg
alt: VitePress
actions:
- theme: brand
text: Get Started
link: /en/guide/get_started/introduction
- theme: alt
text: View on Github
link: https://github.com/geekan/MetaGPT

features:
- title: Agents
details: Explore agent creation, configuration, and management, including algorithms and techniques.
- title: Demos
details: Discover practical applications through projects, case studies, and code examples.
- title: Flows
details: Workflow and process orchestration in multi-agent systems.
---

0 comments on commit 58f2ec7

Please sign in to comment.