Skip to content

Commit

Permalink
feat: support api page type & init api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuan0704 committed Sep 24, 2022
1 parent 571abef commit db5b88e
Show file tree
Hide file tree
Showing 19 changed files with 777 additions and 30 deletions.
22 changes: 20 additions & 2 deletions docs/.island/config.ts
Expand Up @@ -25,12 +25,18 @@ export default defineConfig({
{
text: 'Guide',
link: '/guide/getting-started',
activeMatch: '^/$|^/guide/'
activeMatch: '^/guide/'
},
{
text: 'API',
link: '/api',
activeMatch: '^/api'
}
],

sidebar: {
'/': getTutorialSidebar()
'/': getTutorialSidebar(),
'/api': getApiSidebar()
},

footer: {
Expand Down Expand Up @@ -58,3 +64,15 @@ function getTutorialSidebar() {
}
];
}

function getApiSidebar() {
return [
{
text: 'Config',
items: [
{ text: 'Basic Config', link: '/api/config-basic' },
{ text: 'Theme Config', link: '/api/config-theme' }
]
}
];
}
115 changes: 115 additions & 0 deletions docs/api/config-basic.md
@@ -0,0 +1,115 @@
# Basic Config

## base

- Type: `string`
- Default: `/`

The base URL the site will be deployed at. You can set this to a subdirectory if you plan to deploy your site to a subdirectory of your domain.

For example, if you plan to deploy your site to `https://foo.github.io/bar/`, then you should set `base` to `"/bar/"`:

```js
import { defineConfig } from 'islandjs';

export default defineConfig({
base: '/bar/'
});
```

## title

- Type: `string`
- Default: `"Island"`

The title of the site. This will be used as the title of the home page and the title of the HTML document. For example:

```js
import { defineConfig } from 'islandjs';

export default defineConfig({
title: 'my-site'
});
```

## description

- Type: `string`
- Default: `""`

The description of the site. This will be used as the description of the home page and the description of the HTML document. For example:

```js
import { defineConfig } from 'islandjs';

export default defineConfig({
description: 'This is my site.'
});
```

## icon

- Type: `string`
- Default: `""`

The icon of the site. This will be used as the icon of the home page and the icon of the HTML document. For example:

```js
import { defineConfig } from 'islandjs';

export default defineConfig({
icon: '/icon.png'
});
```

Then Island.js will find your icon in the `public` directory.

## appearance

- Type: `boolean`
- Default: `true`

Whether to appear the dark mode/light mode toggle button. For example:

```js
import { defineConfig } from 'islandjs';

export default defineConfig({
appearance: false
});
```

## outDir

- Type: `string`
- Default: `.island/dist`

The output directory for the built site. For example:

```js
import { defineConfig } from 'islandjs';

export default defineConfig({
outDir: 'dist'
});
```

## vite

- Type: `Object`
- Default: `{}`

The custom config for [Vite](https://vitejs.dev/config/).And the config you passed in will be merged deeply with the default config of Vite. For example:

```js
import { defineConfig } from 'islandjs';

export default defineConfig({
vite: {
// Then your vite plugins will be merged with the default plugins
plugins: [
// ...
]
}
});
```

0 comments on commit db5b88e

Please sign in to comment.