From 5b3604a76b2da603a125f92a9b984f579c613334 Mon Sep 17 00:00:00 2001 From: sanyuan <494130947@qq.com> Date: Wed, 14 Sep 2022 19:42:01 +0800 Subject: [PATCH] chore: add getting-started build and preview step --- docs/guide/getting-started.md | 26 ++++++++++++++++++- .../theme-default/layout/Layout/index.tsx | 1 - src/node/plugin-mdx/index.ts | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 9f1408e0..9dae557d 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -10,6 +10,8 @@ ## Quick Start +### 1. Init project + First, you can use `npm init -y` to init a new project.Then you can install Island with npm, yarn or pnpm: ```bash @@ -24,7 +26,7 @@ pnpm add island-ssg Then you can create file: ```bash -`mkdir docs && echo '# Hello World' > docs/index.md` +mkdir docs && echo '# Hello World' > docs/index.md ``` And then you can add the following scripts in `package.json`: @@ -40,6 +42,8 @@ And then you can add the following scripts in `package.json`: } ``` +### 2. Start dev server + Serve the documentation site in the local server. ```bash @@ -47,3 +51,23 @@ yarn dev ``` Island will start a development server at http://localhost:5173. + +### 3. Build for production + +Build the documentation site for production. + +```bash +yarn build +``` + +Island will generate a static site in the `.island/dist` directory. + +### 4. Preview locally + +Preview the production build locally. + +```bash +yarn preview +``` + +Island will start a production server at http://localhost:4173. diff --git a/src/client/theme-default/layout/Layout/index.tsx b/src/client/theme-default/layout/Layout/index.tsx index 3e97ed14..3a91c619 100644 --- a/src/client/theme-default/layout/Layout/index.tsx +++ b/src/client/theme-default/layout/Layout/index.tsx @@ -16,7 +16,6 @@ export const Layout: React.FC = () => { } = usePageData(); // Priority page title > site title > default title const title = pageTitle || siteData?.title; - const icon = pageIcon || siteData?.icon; // Use doc layout by default const getContentLayout = () => { switch (pageType) { diff --git a/src/node/plugin-mdx/index.ts b/src/node/plugin-mdx/index.ts index 5463316c..fa522142 100644 --- a/src/node/plugin-mdx/index.ts +++ b/src/node/plugin-mdx/index.ts @@ -44,7 +44,7 @@ export async function createMDXOptions(): Promise { [ rehypePluginShiki, { - highlighter: await shiki.getHighlighter({ theme: 'github-dark' }) + highlighter: await shiki.getHighlighter({ theme: 'nord' }) } ], rehypePluginPreWrapper