From d5049a8e2a3aec7a2d51e7dccc451f7bf88ac90f Mon Sep 17 00:00:00 2001 From: winixt Date: Sat, 22 Apr 2023 23:15:14 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BC=98=E5=8C=96=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/config.ts | 66 ++-- .../theme/components/HomeContent.vue | 8 +- docs/.vitepress/theme/components/VPButton.vue | 150 +++++++++ docs/.vitepress/theme/components/VPHero.vue | 256 +++++++++++++++ docs/.vitepress/theme/components/VPImage.vue | 50 +++ docs/guide/getting-started.md | 56 +--- docs/reference/cli/index.md | 29 +- docs/tsconfig.json | 2 +- package.json | 1 + packages/fes-plugin-jest/package.json | 3 +- pnpm-lock.yaml | 293 +++++++++--------- 11 files changed, 684 insertions(+), 230 deletions(-) create mode 100644 docs/.vitepress/theme/components/VPButton.vue create mode 100644 docs/.vitepress/theme/components/VPHero.vue create mode 100644 docs/.vitepress/theme/components/VPImage.vue diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index cf792a7c..ecea0f21 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,36 +1,50 @@ import { defineConfig } from 'vitepress'; -import { withPwa } from '@vite-pwa/vitepress' +import { fileURLToPath, URL } from 'node:url'; +import { withPwa } from '@vite-pwa/vitepress'; import { navbar, sidebar } from './configs'; const BASE_URL = process.env.BASE ? `/${process.env.BASE}/` : '/'; -export default withPwa(defineConfig({ - base: BASE_URL, - title: 'Fes.js', - description: '一个好用的前端应用解决方案', +export default withPwa( + defineConfig({ + base: BASE_URL, + title: 'Fes.js', + description: '一个好用的前端应用解决方案', - head: [ - ['link', { rel: 'icon', href: `/logo.png` }], - ], - - themeConfig: { - logo: '/logo.png', - nav: navbar.zh, - sidebar: sidebar.zh, - - outline: { - label: '本页目录' + vite: { + resolve: { + alias: [ + { + find: /^.*\/VPHero\.vue$/, + replacement: fileURLToPath(new URL('./theme/components/VPHero.vue', import.meta.url)), + }, + ], + }, }, - search: { - provider: 'local' + head: [['link', { rel: 'icon', href: `/logo.png` }]], + + themeConfig: { + socialLinks: [{ icon: 'github', link: 'https://github.com/WeBankFinTech/fes.js' }], + + logo: '/logo.png', + nav: navbar.zh, + sidebar: sidebar.zh, + + outline: { + label: '本页目录', + }, + + search: { + provider: 'local', + }, + + footer: { + message: 'Released under the MIT License.', + copyright: 'Copyright © 2020-present Webank', + }, }, - footer: { - message: 'Released under the MIT License.', - copyright: 'Copyright © 2020-present Webank' - }, - }, - - pwa: {} -})); + pwa: {}, + }), +); diff --git a/docs/.vitepress/theme/components/HomeContent.vue b/docs/.vitepress/theme/components/HomeContent.vue index 00e47b1f..027004e0 100644 --- a/docs/.vitepress/theme/components/HomeContent.vue +++ b/docs/.vitepress/theme/components/HomeContent.vue @@ -1,6 +1,6 @@