Skip to content

Commit

Permalink
chore: add getting-started build and preview step
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuan0704 committed Sep 14, 2022
1 parent d7a2b3c commit 5b3604a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
26 changes: 25 additions & 1 deletion docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`:
Expand All @@ -40,10 +42,32 @@ And then you can add the following scripts in `package.json`:
}
```

### 2. Start dev server

Serve the documentation site in the local server.

```bash
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.
1 change: 0 additions & 1 deletion src/client/theme-default/layout/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/node/plugin-mdx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function createMDXOptions(): Promise<Options> {
[
rehypePluginShiki,
{
highlighter: await shiki.getHighlighter({ theme: 'github-dark' })
highlighter: await shiki.getHighlighter({ theme: 'nord' })
}
],
rehypePluginPreWrapper
Expand Down

0 comments on commit 5b3604a

Please sign in to comment.