Skip to content

Commit

Permalink
docs: 文档更新,依赖升级,模板更新
Browse files Browse the repository at this point in the history
  • Loading branch information
ATQQ committed Jun 8, 2024
1 parent e6e0f1f commit 06356b9
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 138 deletions.
6 changes: 6 additions & 0 deletions packages/blogpress/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ publish: false

# CHANGELOG

## 2.0.48
### Patch Changes

- Updated dependencies
- @sugarat/theme@0.4.0

## 2.0.47

### Patch Changes

- Updated dependencies
Expand Down
4 changes: 2 additions & 2 deletions packages/blogpress/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "blogpress",
"type": "module",
"version": "2.0.47",
"version": "2.0.48",
"private": true,
"license": "MIT",
"scripts": {
Expand All @@ -13,7 +13,7 @@
"@element-plus/icons-vue": "^2.3.1",
"@sugarat/theme": "workspace:*",
"element-plus": "^2.7.2",
"vitepress": "1.2.2",
"vitepress": "1.2.3",
"vitepress-plugin-rss": "workspace:*",
"vue": "^3.4.26"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sugarat/create-theme",
"version": "0.0.61",
"version": "0.0.62",
"description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
"author": "粥里有勺糖",
"license": "MIT",
Expand Down
2 changes: 2 additions & 0 deletions packages/create-theme/public/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ pnpm serve

③ 修改 `docs/.vitepress/config.mts` 里的构建配置

**如果项目名已经为 name.github.io 域名,则不需要修改,保持默认值 `/` 即可**

`base` 改为 `"/仓库名/"` 即可

```ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ const blogTheme = getThemeConfig({

// 搜索
// 默认开启pagefind离线的全文搜索支持(如使用其它的可以设置为false)
// 如果npx pagefind 时间过长,可以手动将其安装为项目依赖 pnpm add pagefind
// search: false,

// markdown 图表支持(会增加一定的构建耗时)
// mermaid: true

// 页脚
footer: {
// message 字段支持配置为HTML内容,配置多条可以配置为数组
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { blogTheme } from './blog-theme'

// 如果使用 GitHub/Gitee Pages 等公共平台部署
// 通常需要修改 base 路径,通常为“/仓库名/”
// 如果项目名已经为 name.github.io 域名,则不需要修改!
// const base = process.env.GITHUB_ACTIONS === 'true'
// ? '/vitepress-blog-sugar-template/'
// : '/'
Expand Down
96 changes: 92 additions & 4 deletions packages/create-theme/public/template/docs/sop/component.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,53 @@ description: 默认支持流程图,tabs面板,待办列表,作品页面
---

# 内置第三方插件能力

部分内置组件(插件),来源 [vitepress.yiov.top](https://vitepress.yiov.top/plugin.html) 推荐

## oml2d - 看板娘集成
* Type:[oml2dOptions](https://oml2d.com/options/Options.html)

为网站提供一个 Live2D 看板组件。

:::tip 一点说明
通过内置 [oh-my-live2d](https://oml2d.com) 实现, 可以通过 `oml2d` 选项配置。

通过这个能力可以快速加入并定制属于自己的看板娘, 开启只需要为其传递一个 [配置选项](https://oml2d.com/options/Options.html) 即可
:::

以下是一个简单的使用示例,当模型加载成功时它将出现在您网站的左下角。

```ts
const blogTheme = getThemeConfig({
oml2d: {
mobileDisplay: true,
models: [
{
path: 'https://registry.npmmirror.com/oml2d-models/latest/files/models/Senko_Normals/senko.model3.json'
}
]
}
})
```
效果图如下

![](https://loclink-1259720482.cos.ap-beijing.myqcloud.com/image/%E5%BD%95%E5%B1%8F2024-03-11%2023.51.51.gif)

之后您还可以前往[配置选项](https://oml2d.com/options/Options.html)查阅更多自定义内容

:::tip 版本说明
由于时间原因,主题内置的版本不一定都是最新的,可以通过 `resolutions` 配置指定要使用的版本。

下面是使用示例,配置在 `package.json` 中,其它依赖覆盖版本也是这样操作。
```json
{
"resolutions": {
"oh-my-live2d": "^0.17.0"
}
}
```
:::

## task-checkbox
* Type: `boolean | TaskCheckbox`

Expand Down Expand Up @@ -46,8 +93,48 @@ interface TaskCheckbox {
```
:::

## timeline
* Type: `boolean`
* default: `true`

提供 markdown 时间线语法,在 vitepress 中使用 markdown 渲染时间线(时间轴)样式。

:::tip 一点说明
内置 [vitepress-markdown-timeline](https://github.com/HanochMa/vitepress-markdown-timeline) 实现
:::

效果如下

::: timeline 2023-05-24
- **do some thing1**
- do some thing2
:::

::: timeline 2023-05-23
do some thing3
do some thing4
:::

语法如下
```md
::: timeline 2023-05-24
- **do some thing1**
- do some thing2
:::

::: timeline 2023-05-23
do some thing3
do some thing4
:::
```

:::code-group
```ts [关闭]
const blogTheme = getThemeConfig({
timeline: false
})
```
:::
## tabs
* Type: `boolean`

Expand Down Expand Up @@ -166,12 +253,12 @@ flowchart TD
Start --> Stop
```

**默认开启**可以通过`mermaid`进行进一步配置,或关闭
**默认关闭**可以通过设置 `mermaid: true` 开启,或进行进一步配置。

:::code-group
```ts [① 关闭]
```ts [① 开启]
const blogTheme = getThemeConfig({
mermaid: false
mermaid: true
})
```
```ts [② 进一步配置]
Expand Down Expand Up @@ -210,12 +297,13 @@ gantt
Parallel 4 : des6, after des4, 1d
```


## UserWorksPage
* Type: `UserWorks`

用于作品列表展示

效果如下,详见 [个人作品展示](https://theme.sugarat.top/work.html)
效果如下,详见 [个人作品展示](./../work.md)

![](https://img.cdn.sugarat.top/mdImg/MTY4NzA4ODczMzkwNg==687088733906)

Expand Down
4 changes: 2 additions & 2 deletions packages/create-theme/public/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@sugarat/theme": "^0.3.6",
"@sugarat/theme": "^0.4.0",
"element-plus": "^2.7.2",
"vue": "3.4.26"
},
Expand All @@ -22,7 +22,7 @@
"pagefind": "^1.1.0",
"sass": "^1.76.0",
"typescript": "^5.4.5",
"vitepress": "1.2.2"
"vitepress": "1.2.3"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
4 changes: 1 addition & 3 deletions packages/theme/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## 0.4.0

### Patch Changes

**break change!**
### Minor Changes

- feat: support diy friend & tags title
- fix: readme spelling error.
Expand Down
2 changes: 2 additions & 0 deletions packages/theme/docs/sop/gh-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ jobs:
③ 修改 `docs/.vitepress/config.mts` 里的构建配置

**如果项目名已经为 name.github.io 域名,则不需要修改,保持默认值 `/` 即可**

`base` 改为 `"/仓库名/"` 即可

```ts
Expand Down
8 changes: 0 additions & 8 deletions packages/theme/documate.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sugarat/theme",
"version": "0.3.6",
"version": "0.4.0",
"description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
"author": "sugar",
"license": "MIT",
Expand Down
Loading

0 comments on commit 06356b9

Please sign in to comment.