Skip to content

Commit

Permalink
fix: 排除所有index.md的git历史记录元素
Browse files Browse the repository at this point in the history
feat: 添加评论
  • Loading branch information
ikenxuan committed Jul 23, 2024
1 parent 516cabd commit 93db801
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default defineConfig({
repoURL: () => 'https://github.com/KarinJS/Karin',
}),
GitChangelogMarkdownSection({
exclude: (id) => id.endsWith('index.md'),
sections: {
// 禁用页面历史
disableChangelog: false,
Expand Down
22 changes: 21 additions & 1 deletion docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import {
import '@nolebase/vitepress-plugin-page-properties/client/style.css'
// <mark> 元素增强
import '@nolebase/vitepress-plugin-enhanced-mark/client/style.css'
// 页面底部评论
import giscusTalk from 'vitepress-plugin-comment-with-giscus'

export default {
extends: DefaultTheme,
Expand Down Expand Up @@ -96,9 +98,27 @@ export default {

/** 响应式图片缩放 */
setup () {
const route = useRoute()
// 获取前言和路由
const route = useRoute()
const { frontmatter } = useData()
// giscus配置
giscusTalk({
repo: 'KarinJS/Karin', //仓库
repoId: 'R_kgDOLcebnw', //仓库ID
category: 'Announcements', // 讨论分类
categoryId: 'DIC_kwDOLcebn84CeJZH', //讨论分类ID
mapping: 'pathname',
inputPosition: 'bottom',
lang: 'zh-CN',
},
{
frontmatter, route
},
//默认值为true,表示已启用,此参数可以忽略;
//如果为false,则表示未启用
//您可以使用“comment:true”序言在页面上单独启用它
true
)
// 代码块添加折叠
codeblocksFold({ route, frontmatter }, true, 400)

Expand Down
3 changes: 3 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
comment: false
---
# 目录

> 正在编写中,咕咕咕~
Expand Down
3 changes: 3 additions & 0 deletions docs/event/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
comment: false
---
# 事件

---
Expand Down
3 changes: 3 additions & 0 deletions docs/plugins/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
comment: false
---
# 插件

## 插件规范
Expand Down
16 changes: 10 additions & 6 deletions docs/start/index.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
---
comment: false
---
# 目录
::: tip 温馨提示
如果文档中发现错误,或提交文档修改,或丰富本站文档,可点击页面底部的编辑按钮
:::

### 快速开始
<br>
<NCard title="🎲 安装karin" link="start/">
<NCard title="🎲 安装karin" link="../../Karin/start/start#环境">
第一次使用 Karin 而且晕头转向?来看看这份安装指引吧!
</NCard>

### 渲染器
<br>
<NCard title="📑 安装渲染器" link="render/">
<NCard title="📑 安装渲染器" link="../../Karin/start/render#渲染器安装">
Karin 的渲染器是独立的一个项目,需要单独安装噢
</NCard>

### 插件
<br>
<NCard title="😍 安装插件" link="../plugins/">
<NCard title="😍 安装插件" link="../../Karin/plugins/list#📜用户须知">
Karin 社区拥有众多开发者,开发了许多特色插件,你可以在插件市场找到你想要的插件~
</NCard>

---
::: tip 温馨提示
如果文档中发现错误,或提交文档修改,或丰富本站文档,可点击页面底部的编辑按钮
:::

<!-- - <Badge type="info" text="default" />
- <Badge type="tip" text="^1.9.0" />
Expand Down
2 changes: 1 addition & 1 deletion docs/start/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
以下,除了`Node.js`,其他均为可选项,根据实际情况进行安装。
:::

### NodeJs <Badge type="danger" text="必装 " />
### Node.js <Badge type="danger" text="必装 " />

[Node.js官网][Node.js]

Expand Down
3 changes: 3 additions & 0 deletions docs/utils/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
comment: false
---
# 开发工具

## karin
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"medium-zoom": "^1.1.0",
"vitepress-markdown-timeline": "^1.2.1",
"vitepress-plugin-codeblocks-fold": "^1.2.28",
"vitepress-plugin-comment-with-giscus": "^1.1.15",
"vue": "^3.4.33"
}
}

0 comments on commit 93db801

Please sign in to comment.