Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbb4ed5
commit 2ab6910
Showing
17 changed files
with
206 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# API Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Doc Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Home Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# I18n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# NavBar | ||
|
||
The nav bar is very important for a website. It allows users to quickly jump between different pages of the website, and also allows users to quickly find some important information on the website. | ||
|
||
Island.js default theme has built-in navbar module, you can configure it in `themeConfig.navbar`. | ||
|
||
The nav bar is configured as an array, each item in the array is a `NavItem` object, which has the following types: | ||
|
||
```ts | ||
export type NavItem = NavItemWithLink | NavItemWithChildren; | ||
``` | ||
|
||
That is, each navbar element ( `NavItem` ) can be either a link ( `NavItemWithLink` ) or a navbar group with child elements ( `NavItemWithChildren` ). | ||
|
||
## NavItemWithLink | ||
|
||
```ts | ||
export interface NavItemWithLink { | ||
text: string; | ||
link: string; | ||
activeMatch?: string; | ||
} | ||
``` | ||
|
||
The meaning of each attribute is as follows: | ||
|
||
- `text` - nav item text | ||
- `link` - nav item link | ||
- `activeMatch` - activation rules for navbar links | ||
|
||
`activeMatch` is used to match the current route. When the route matches the `activeMatch` rule, the nav item will be highlighted. | ||
|
||
> By default, `activeMatch` is the NavItem's `link` property. | ||
## NavItemWithChildren | ||
|
||
```ts | ||
export interface NavItemWithChildren { | ||
text: string; | ||
children: NavItem[]; | ||
} | ||
``` | ||
|
||
The meaning of each attribute is as follows: | ||
|
||
- `text` - navbar item text | ||
- `children` - child nav items | ||
|
||
## Example | ||
|
||
```js | ||
import { defineConfig } from 'islandjs'; | ||
|
||
export default defineConfig({ | ||
themeConfig: { | ||
navbar: [ | ||
{ | ||
text: 'Home', | ||
link: '/', | ||
activeMatch: '^/$|^/' | ||
}, | ||
{ | ||
text: 'More Pages', | ||
children: [ | ||
{ | ||
text: 'Github', | ||
link: 'http://github.com/sanyuan0704/island.js', | ||
}, | ||
{ | ||
text: 'Twitter', | ||
link: 'http://twitter.com/sanyuan0704', | ||
}, | ||
} | ||
] | ||
} | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# API 页面 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 正文页面 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Home 页面 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 国际化 | ||
|
||
Island |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# 导航栏模块 | ||
|
||
导航栏对一个网站来说非常重要,它可以让用户快速的在网站的不同页面之间进行跳转,也可以让用户快速的找到网站的一些重要信息。 | ||
|
||
Island.js 默认主题内置了导航栏模块,你可以在 `themeConfig.navbar` 中进行配置。 | ||
|
||
导航栏配置为一个数组,数组中的每一项都是一个 `NavItem` 对象,它具有以下类型: | ||
|
||
```ts | ||
export type NavItem = NavItemWithLink | NavItemWithChildren; | ||
``` | ||
|
||
也就是说,每个导航栏元素( `NavItem` )可以是一个链接( `NavItemWithLink` ),也可以是一个包含子元素的导航栏组( `NavItemWithChildren` )。 | ||
|
||
## NavItemWithLink | ||
|
||
```ts | ||
export interface NavItemWithLink { | ||
text: string; | ||
link: string; | ||
activeMatch?: string; | ||
} | ||
``` | ||
|
||
其中各项属性的含义如下: | ||
|
||
- `text` - 导航栏文本 | ||
- `link` - 导航栏链接 | ||
- `activeMatch` - 导航栏链接的激活规则 | ||
|
||
`activeMatch` 用于匹配当前路由,当路由匹配 `activeMatch` 规则时,nav 项会高亮显示。 | ||
|
||
> 默认情况下,`activeMatch` 是 NavItem 的 `link` 属性。 | ||
## NavItemWithChildren | ||
|
||
```ts | ||
export interface NavItemWithChildren { | ||
text: string; | ||
children: NavItem[]; | ||
} | ||
``` | ||
|
||
其中各项属性的含义如下: | ||
|
||
- `text` - 导航栏文本 | ||
- `children` - 子导航栏元素 | ||
|
||
## 示例 | ||
|
||
```js | ||
import { defineConfig } from 'islandjs'; | ||
|
||
export default defineConfig({ | ||
themeConfig: { | ||
navbar: [ | ||
{ | ||
text: 'Home', | ||
link: '/', | ||
activeMatch: '^/$|^/' | ||
}, | ||
{ | ||
text: '更多链接', | ||
children: [ | ||
{ | ||
text: 'Github', | ||
link: 'http://github.com/sanyuan0704/island.js', | ||
}, | ||
{ | ||
text: 'Twitter', | ||
link: 'http://twitter.com/sanyuan0704', | ||
}, | ||
} | ||
] | ||
} | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 搜索 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2ab6910
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
island – ./
island-git-master-sanyuan0704.vercel.app
island-navy.vercel.app
island-vercel.sanyuan0704.top
island-sanyuan0704.vercel.app