diff --git a/.gitignore b/.gitignore index 15ea5dc..17adf65 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ node_modules/ .cache/ .asset-cache/ .sass-cache/ -_site/ + +src/jekyll/_data/knosys/ +src/jekyll/_knosys/ +src/jekyll/_site/ diff --git a/.knosysrc b/.knosysrc index 41d192c..1458185 100644 --- a/.knosysrc +++ b/.knosysrc @@ -3,6 +3,7 @@ "default": { "alias": "lime", "source": "./src/jekyll", + "data": "./man", "git": { "url": "https://github.com/ourai/lime.git", "branch": "gh-pages" diff --git a/man/cookbook/.meta/basic.yml b/man/cookbook/.meta/basic.yml new file mode 100644 index 0000000..78b3aa9 --- /dev/null +++ b/man/cookbook/.meta/basic.yml @@ -0,0 +1 @@ +permalink: /:collection/:path/ diff --git a/man/cookbook/apis/site-config/entity.yml b/man/cookbook/apis/site-config/entity.yml new file mode 100644 index 0000000..5309037 --- /dev/null +++ b/man/cookbook/apis/site-config/entity.yml @@ -0,0 +1 @@ +title: 网站配置 diff --git a/man/cookbook/apis/site-config/readme.md b/man/cookbook/apis/site-config/readme.md new file mode 100644 index 0000000..692ea39 --- /dev/null +++ b/man/cookbook/apis/site-config/readme.md @@ -0,0 +1,43 @@ +在 `_config.yml` 文件中声明的用于控制主题预置渲染逻辑的配置项,它们都挂在 `ksio` 下面,通过 `site.ksio` 访问—— + +配置项「值类型」有 `Link` 字样的,代表 `Link` 是一个描述链接信息的对象,用 TypeScript 的类型表现为: + +{% highlight typescript %} +interface Link { + text: string; + url?: string; + children?: Link[]; +} +{% endhighlight %} + +可用配置项有: + +| 属性名 | 值类型/可选值 | 默认值 | 说明 | +| --- | --- | --- | --- | +| `brand` | `object` | - | 品牌相关配置,主要控制页头左上角的链接与文本,详见下方 | +| `navs` | `Link[]` | - | 页面头部导航 | +| `links` | `Link[]` | - | 页面底部链接 | +| `modules` | `object` | - | 模块功能控制,详见下方 | + +## `brand` + +| 属性名 | 值类型/可选值 | 默认值 | 说明 | +| --- | --- | --- | --- | +| `text` | `string` | `site.title` | 当前网站品牌所要显示的文本,不指定则显示网站标题 | +| `parent` | `Link` | - | 当前网站的父品牌,指定后会在当前网站品牌的左边显示 | + +## `modules` + +| 属性名 | 值类型/可选值 | 默认值 | 说明 | +| --- | --- | --- | --- | +| `social` | `object` | - | 社交相关功能的开关与配置,详见下方 | + +### `social` + +结构、默认值与说明如下: + +{% highlight js %} +{ + share: false, // 是否启用将页面分享到其他 SNS 的按钮 +} +{% endhighlight %} diff --git a/src/jekyll/_data/local/repos.yml b/src/jekyll/_data/local/repos.yml index fe88a9c..17d3cc8 100644 --- a/src/jekyll/_data/local/repos.yml +++ b/src/jekyll/_data/local/repos.yml @@ -5,3 +5,7 @@ cookbook: - text: 概述 collection: pages slug: guides + - text: API + collection: apis + items: + - site-config