From 58f2ec75894a0046b06fa12d8847c10681c2dcc0 Mon Sep 17 00:00:00 2001 From: zerolee <464806884@qq.com> Date: Thu, 21 Dec 2023 17:52:41 +0800 Subject: [PATCH] fix: ensure copy dest dir exist --- .vitepress/config.mts | 13 ++++++++++--- src/index.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 src/index.md diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 86403a12..d1389a65 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -6,12 +6,11 @@ import { existsSync, cpSync, readdirSync, - stat, statSync, - copyFile, copyFileSync, readFileSync, writeFileSync, + mkdirSync, } from 'node:fs'; import { simpleGit } from 'simple-git'; @@ -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)); @@ -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', + }); } }; diff --git a/src/index.md b/src/index.md new file mode 100644 index 00000000..6101aa4a --- /dev/null +++ b/src/index.md @@ -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. +---