Skip to content

Commit f83e61f

Browse files
committed
docs: add Yohaku (余白) theme documentation and update homepage hero
Add Yohaku as the successor to Shiro theme with design philosophy, config reference, sponsorship info, and live screenshots from innei.in. Update homepage hero carousel to feature Yohaku and Shiro.
1 parent cc93ee0 commit f83e61f

10 files changed

Lines changed: 360 additions & 3 deletions

File tree

app/components/ThemeShowcase.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React from 'react'
44
import Image from 'next/image'
55
import { Card, Cards } from 'fumadocs-ui/components/card'
66
import { FaGithub } from 'react-icons/fa'
7+
import yohakuPreview from '@/public/assets/images/preview/yohaku.png';
78
import shiroPreview from '@/public/assets/images/preview/shiro.png';
89
import kamiPreview from '@/public/assets/images/preview/kami.png';
910
import yunPreview from '@/public/assets/images/preview/yun.png';
@@ -52,6 +53,12 @@ const ThemeCard = ({ title, preview, href, github }: ThemeProps) => {
5253

5354
const ThemeShowcase: React.FC = () => {
5455
const themes = [
56+
{
57+
title: '余白 / Yohaku (@innei)',
58+
preview: yohakuPreview,
59+
href: '/docs/themes/yohaku',
60+
github: 'https://github.com/Innei/Yohaku'
61+
},
5562
{
5663
title: 'Shiro (@innei)',
5764
preview: shiroPreview,

app/components/home/Hero.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import Link from 'next/link'
44
import Image from 'next/image'
55
import { useState, useEffect, useRef } from 'react'
66
const images = [
7+
'/assets/images/preview/yohaku.png',
78
'/assets/images/preview/shiro.png',
8-
'/assets/images/preview/kami.png',
9-
'/assets/images/preview/console.png',
109
]
11-
const imageNames = ['Shiro 主题', 'Kami 主题', '控制台']
10+
const imageNames = ['余白 / Yohaku', 'Shiro 主题']
1211
import { cn } from 'utils/cn'
1312
import { buttonVariants } from 'app/components/ui/button'
1413
import { LuCirclePlay } from 'react-icons/lu'

content/docs/themes/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "部署 Mix Space 的前端主题",
55
"icon": "PaintRoller",
66
"pages": [
7+
"yohaku",
78
"shiro",
89
"kami",
910
"yun",

content/docs/themes/shiro/deploy.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import Image from 'next/image'
1010

1111
<ToGithub repo="Innei/Shiro" />
1212

13+
<Callout type="info">
14+
Shiro 的下一代演进版本 **[余白 / Yohaku](/docs/themes/yohaku)** 已经发布。Yohaku 基于 Shiro 深度重构,提供更精致的视觉设计与更多功能。如果你正在寻找最新的体验,请前往 [Yohaku 文档](/docs/themes/yohaku) 了解更多。
15+
</Callout>
16+
1317
## 前提要求
1418

1519
- 你已安装 Mix Space 后端并且已启动
Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
---
2+
title: 配置
3+
description: 余白 / Yohaku 的配置文件信息
4+
icon: Bolt
5+
---
6+
7+
# 配置项
8+
9+
Yohaku 的配置沿用 Shiro 的配置体系,在 Mix Space 后台「配置与云函数」页面中,创建一条 `theme` 引用、名称为 `shiro` 的配置项(数据类型 JSON 或 YAML)。
10+
11+
<Callout type="info">
12+
Yohaku 复用了 `shiro` 这个配置键名,如果你从 Shiro 迁移到 Yohaku,无需更改配置名称。
13+
</Callout>
14+
15+
## 页脚信息 (`footer`)
16+
17+
此部分定义页脚的部分信息,主要包括备案、建站年份和页脚导航三部分。
18+
19+
### 备案信息 (`otherInfo.icp`)
20+
21+
**如何使用**: 根据示例,修改位于 `text` 的备案号以及备案号所指向的链接 `link`
22+
23+
### 建站年份 (`otherInfo.date`)
24+
25+
**如何使用**: `{{now}}` 指向当前年份,其他略。
26+
27+
### 页脚导航 (`linkSections`)
28+
29+
分类包括 `name``links` 两个字段,对应分类名字及其下链接,其下链接又分为 `name``href``external` 三个字段,对应链接名字,指向链接和是否外链三个属性。
30+
31+
**如何使用**: 根据自己需要增删或修改特定链接及分类,需要注意如果指向外链的话需要加一行 `"external": true`
32+
33+
## 站点信息 (`config.site`)
34+
35+
此部分包含了网站的基础信息设置,例如 favicon(网站图标)的配置。
36+
37+
### Favicon
38+
39+
- **`favicon`**: 设置网站在浅色模式下使用的图标。
40+
- **`faviconDark`**: 设置网站在深色模式下使用的图标。
41+
42+
## Hero 部分 (`config.hero`)
43+
44+
`hero` 部分定义了网站首页的主要欢迎信息或介绍部分,这是访问者首次进入网站时看到的部分。
45+
46+
### Title 模板 (`title.template`)
47+
48+
包括多个元素(如 `h1`, `code`, `span`),每个元素都可以自定义文本内容和样式(通过 CSS 类)。
49+
50+
**如何使用**: 修改 `text``class` 字段来自定义标题的文本内容和样式。你可以通过添加或删除元素来调整标题的结构。
51+
52+
### 描述 (`description`)
53+
54+
提供了对主页 `hero` 部分的简短描述。
55+
56+
**如何使用**: 直接修改 `description` 的值以更改介绍文本。
57+
58+
### 一言 (`hitokoto`)
59+
60+
提供自定义首页一言的功能。
61+
62+
接受一个对象,包含 `random``custom` 两个可选字段。
63+
64+
- 当存在 `random` 字段且值为 `true` 时,将会随机获取一言,优先级高于 `custom` 字段。
65+
- 当存在 `custom` 字段时,将会使用自定义的一言。
66+
- 如果两个字段都不存在,将会使用默认的一言。
67+
68+
```ts
69+
interface Hitokoto {
70+
random?: boolean
71+
custom?: string
72+
}
73+
```
74+
75+
## 自定义脚本 (`config.custom`)
76+
77+
可以配置自定义的 CSS, Script。
78+
79+
### Scripts (`scripts`)
80+
81+
接受一个 [Script](https://nextjs.org/docs/app/api-reference/components/script#props) Props 参数数组。
82+
83+
### Styles (`styles`)
84+
85+
自定义 CSS。接受一个字符串数组。
86+
87+
### JavaScript tag (`js`)
88+
89+
自定义 JS 脚本。接受一个字符串数组。
90+
91+
### CSS href link (`css`)
92+
93+
加载外部 CSS,接受一个 CSS 外部样式表链接数组。
94+
95+
## 模块 (`config.module`)
96+
97+
此部分配置了网站的一些特定功能模块,比如活动跟踪、捐赠支持、社交媒体链接等。
98+
99+
### 实时活动 (`activity`) 模块
100+
101+
- **`enable`**: 控制模块是否启用。
102+
- **`endpoint`**: 指定活动更新的服务器端点。
103+
104+
**如何使用**: 若需开启活动跟踪功能,将 `enable` 设为 `true` 并设置 `endpoint` 为处理活动数据的服务器地址。
105+
106+
### 捐赠 (`donate`) 模块
107+
108+
- **`enable`**: 控制捐赠模块是否启用。
109+
- **`link`**: 提供捐赠页面的链接。
110+
- **`qrcode`**: 提供一或多个捐赠二维码图片的链接。
111+
112+
**如何使用**: 启用捐赠功能,并提供捐赠链接或捐赠二维码,以便支持者可以直接进行捐赠。
113+
114+
### 社交媒体 (`bilibili`) 模块
115+
116+
- **`liveId`**: b 站直播间 ID
117+
118+
### OpenPanel 模块
119+
120+
[OpenPanel](https://openpanel.dev) 是一个开源的网站分析工具。
121+
122+
- **`enable`**: 控制 OpenPanel 功能是否启用。
123+
- **`id`**: OpenPanel 的 ID。
124+
- **`url`**: OpenPanel 的访问地址。
125+
126+
**如何使用**: 如果你使用 OpenPanel 进行网站分析,通过这些配置连接并启用面板。
127+
128+
### 文章列表设定 (`posts`)
129+
130+
- **`mode`**: 文章列表的预览模式。可选值:`"loose"`(默认)、`"compact"`
131+
132+
两个模式,紧凑模式和松散模式。
133+
134+
### RSS 配置 (`rss`)
135+
136+
- **`noRSS`**: 设为 `true` 可禁用 RSS 输出。
137+
- **`custom_elements`**: 自定义 RSS 元素数组。
138+
139+
### 签名动画 (`signature`) 模块
140+
141+
- **`svg`**: 签名的 SVG 代码。
142+
- **`animated`**: 是否启用动画效果,默认为 `true`
143+
144+
**如何使用**: SVG 代码可通过 [此网站](https://danmarshall.github.io/google-font-to-svg-path/) 生成。
145+
146+
<Callout type="warning">
147+
受限于 JSON 语法规则,SVG 代码需替换所有的 `"``\"`,否则会报错。
148+
</Callout>
149+
150+
### OG 图片 (`og`)
151+
152+
- **`avatar`**: 自定义 Open Graph 图片中的头像 URL。
153+
154+
### 订阅 (`subscription`)
155+
156+
- **`tg`**: Telegram 频道链接,用于展示订阅入口。
157+
158+
## 配置示例
159+
160+
```json
161+
{
162+
"footer": {
163+
"otherInfo": {
164+
"date": "2020-{{now}}",
165+
"icp": {
166+
"text": "萌 ICP 备 20236136 号",
167+
"link": "https://icp.gov.moe/?keyword=20236136"
168+
}
169+
},
170+
"linkSections": [
171+
{
172+
"name": "关于",
173+
"links": [
174+
{ "name": "关于本站", "href": "/about-site" },
175+
{ "name": "关于我", "href": "/about" },
176+
{
177+
"name": "关于此项目",
178+
"href": "https://github.com/Innei/Yohaku",
179+
"external": true
180+
}
181+
]
182+
},
183+
{
184+
"name": "更多",
185+
"links": [
186+
{ "name": "时间线", "href": "/timeline" },
187+
{ "name": "友链", "href": "/friends" }
188+
]
189+
},
190+
{
191+
"name": "联系",
192+
"links": [
193+
{ "name": "写留言", "href": "/message" },
194+
{ "name": "GitHub", "href": "https://github.com/innei", "external": true }
195+
]
196+
}
197+
]
198+
},
199+
"config": {
200+
"color": {
201+
"light": ["#33A6B8", "#FF6666", "#26A69A", "#fb7287", "#69a6cc"],
202+
"dark": ["#F596AA", "#A0A7D4", "#ff7b7b", "#99D8CF", "#838BC6"]
203+
},
204+
"site": {
205+
"favicon": "/favicon.svg",
206+
"faviconDark": "/favicon-dark.svg"
207+
},
208+
"hero": {
209+
"title": {
210+
"template": [
211+
{ "type": "h1", "text": "Hi, I'm ", "class": "font-light text-4xl" },
212+
{ "type": "h1", "text": "Name", "class": "font-medium mx-2 text-4xl" },
213+
{ "type": "h1", "text": "👋。", "class": "font-light text-4xl" },
214+
{ "type": "br" },
215+
{ "type": "h1", "text": "A ", "class": "font-light text-4xl" },
216+
{
217+
"type": "code",
218+
"text": "<Developer />",
219+
"class": "font-medium mx-2 text-3xl rounded p-1"
220+
}
221+
]
222+
},
223+
"description": "An independent developer coding with love."
224+
},
225+
"module": {
226+
"activity": {
227+
"enable": true,
228+
"endpoint": "/fn/ps/update"
229+
},
230+
"donate": {
231+
"enable": false,
232+
"link": "",
233+
"qrcode": []
234+
},
235+
"bilibili": {
236+
"liveId": 0
237+
},
238+
"openpanel": {
239+
"enable": false,
240+
"id": "",
241+
"url": ""
242+
},
243+
"posts": {
244+
"mode": "loose"
245+
},
246+
"signature": {
247+
"svg": "",
248+
"animated": true
249+
}
250+
}
251+
}
252+
}
253+
```
254+
255+
<Callout type="info">
256+
请注意,这份配置你需要自行修改成符合你需求的内容。更多配置项的信息请参考上方各字段说明。
257+
258+
配置也可写成 YAML 格式,此时数据类型应选择 `YAML`
259+
</Callout>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: 余白 / Yohaku
3+
description: Shiro 的设计继承者——以「留白」为核心理念的个人博客视觉体系
4+
icon: Sparkles
5+
---
6+
7+
import { ToGithub } from '@/app/components/ToGithub'
8+
import Image from 'next/image'
9+
10+
<ToGithub repo="Innei/Yohaku" />
11+
12+
## 概述
13+
14+
**Yohaku**(余白)取自日文,意为**留白**。它是 [Shiro](/docs/themes/shiro/deploy) 的设计继承者,基于 Shiro 深度重构而来,延续了「纸的纯净与雪的清新」的设计语言,并在此基础上进一步打磨视觉体验与交互细节。
15+
16+
<Image
17+
src="/assets/images/preview/yohaku.png"
18+
alt="Yohaku 首页预览"
19+
width={1440}
20+
height={900}
21+
className="rounded-lg border"
22+
/>
23+
24+
<Image
25+
src="/assets/images/preview/yohaku-posts.png"
26+
alt="Yohaku 文章列表"
27+
width={1440}
28+
height={900}
29+
className="rounded-lg border mt-4"
30+
/>
31+
32+
<Image
33+
src="/assets/images/preview/yohaku-notes.png"
34+
alt="Yohaku 手记页面"
35+
width={1440}
36+
height={900}
37+
className="rounded-lg border mt-4"
38+
/>
39+
40+
## 开源说明
41+
42+
<Callout type="warn">
43+
[Innei/Yohaku](https://github.com/Innei/Yohaku) 仓库为**设计语言的公开存档**,记录视觉规范与设计决策,不包含可运行的完整代码。
44+
45+
完整的可部署代码以闭源方式维护于私有仓库,**需要赞助后才可获得访问权限**
46+
</Callout>
47+
48+
### 如何获取完整实现
49+
50+
1. 前往 [github.com/sponsors/Innei](https://github.com/sponsors/Innei) 赞助
51+
2. 赞助后通过 [Issues](https://github.com/Innei/Yohaku/issues) 或邮件告知你的 GitHub 用户名
52+
3. 作者会手动添加私有仓库的访问权限
53+
54+
[![Sponsor](https://img.shields.io/badge/Sponsor-Innei-ea4aaa?logo=github-sponsors&logoColor=white)](https://github.com/sponsors/Innei)
55+
56+
## 设计哲学
57+
58+
整站以**个人书写**为隐喻。页面像一封徐徐展开的信纸,文字与空白共同构成节奏,内容如手帐般自然散落。
59+
60+
- **颜色是克制的** — 浅色模式接近真实纸张的米白,深色模式沉入暖灰
61+
- **动画是呼吸式的** — 元素随滚动自然浮现,而非弹出
62+
- **字体是有质感的** — 标题用衬线字体,注释以斜体呈现
63+
- **交互是低调的** — 悬停时仅颜色微微加深,如纸面被指尖轻触
64+
65+
## 设计规范
66+
67+
| 维度 | 浅色 | 深色 |
68+
|------|------|------|
69+
| 强调色 | 浅葱 `#33A6B8` |`#F596AA` |
70+
| 背景底色 | `#fefefb`(纸张本白) | `rgb(28,28,30)`(暖灰夜色) |
71+
| 动效缓动 | `cubic-bezier(0.22, 1, 0.36, 1)` | 同左 |
72+
| 基础字号 | 14px | 同左 |
73+
74+
## 与 Shiro 的关系
75+
76+
Yohaku 是 Shiro 的下一代演进。如果你正在使用 Shiro,可以继续使用——Shiro 仍然是一个完整的开源主题。Yohaku 在 Shiro 的基础上提供了更精致的视觉设计和更多闭源独有功能。
77+
78+
## 相关链接
79+
80+
- [Innei/Yohaku](https://github.com/Innei/Yohaku) — 开源设计存档
81+
- [Innei/Shiro](https://github.com/Innei/Shiro) — 开源前身
82+
- [在线演示](https://innei.in) — 作者的个人博客,使用 Yohaku 驱动

0 commit comments

Comments
 (0)