Skip to content

Commit

Permalink
docs: add site config doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ourai committed Mar 23, 2023
1 parent b6d7b58 commit e80ba46
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ node_modules/
.cache/
.asset-cache/
.sass-cache/
_site/

src/jekyll/_data/knosys/
src/jekyll/_knosys/
src/jekyll/_site/
1 change: 1 addition & 0 deletions .knosysrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"default": {
"alias": "lime",
"source": "./src/jekyll",
"data": "./man",
"git": {
"url": "https://github.com/ourai/lime.git",
"branch": "gh-pages"
Expand Down
1 change: 1 addition & 0 deletions man/cookbook/.meta/basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
permalink: /:collection/:path/
1 change: 1 addition & 0 deletions man/cookbook/apis/site-config/entity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: 网站配置
43 changes: 43 additions & 0 deletions man/cookbook/apis/site-config/readme.md
Original file line number Diff line number Diff line change
@@ -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 %}
4 changes: 4 additions & 0 deletions src/jekyll/_data/local/repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ cookbook:
- text: 概述
collection: pages
slug: guides
- text: API
collection: apis
items:
- site-config

0 comments on commit e80ba46

Please sign in to comment.