diff --git a/README.md b/README.md
index e1a4da8..07040a9 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
> [!WARNING]
> 目前仍处于 Beta 测试阶段,欢迎反馈测试结果。
-
+
# cwd-comments
diff --git a/docs/.vitepress/components/footerDoc.vue b/docs/.vitepress/components/footerDoc.vue
new file mode 100644
index 0000000..ec2f27f
--- /dev/null
+++ b/docs/.vitepress/components/footerDoc.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs
index 449becb..ebaae03 100644
--- a/docs/.vitepress/config.mjs
+++ b/docs/.vitepress/config.mjs
@@ -24,6 +24,7 @@ export default defineConfig({
{ text: '快速开始', link: '/guide/getting-started' },
{ text: '后端配置', link: '/guide/backend-config' },
{ text: '前端配置', link: '/guide/frontend-config' },
+ { text: '管理后台', link: '/guide/admin-panel' },
]
},
{
diff --git a/docs/.vitepress/theme/index.js b/docs/.vitepress/theme/index.js
new file mode 100644
index 0000000..77c44da
--- /dev/null
+++ b/docs/.vitepress/theme/index.js
@@ -0,0 +1,15 @@
+import DefaultTheme from 'vitepress/theme'
+import { h } from 'vue'
+import FooterDoc from '../components/footerDoc.vue'
+
+export default {
+ ...DefaultTheme,
+ Layout() {
+ const Layout = DefaultTheme.Layout
+
+ return h(Layout, null, {
+ 'doc-footer-before': () => h(FooterDoc),
+ })
+ },
+}
+
diff --git a/docs/guide/admin-dashboard.md b/docs/guide/admin-panel.md
similarity index 100%
rename from docs/guide/admin-dashboard.md
rename to docs/guide/admin-panel.md
diff --git a/docs/guide/frontend-config.md b/docs/guide/frontend-config.md
index 9721c45..2ea1000 100644
--- a/docs/guide/frontend-config.md
+++ b/docs/guide/frontend-config.md
@@ -13,7 +13,6 @@
const comments = new CWDComments({
el: '#comments',
apiBaseUrl: 'https://your-api.example.com',
- postSlug: window.location.origin + window.location.pathname,
});
comments.mount();
@@ -25,10 +24,11 @@
| ------------ | ----------------------- | ---- | ---------------------------------------------------------------- | ------------------------- |
| `el` | `string \| HTMLElement` | 是 | - | 挂载元素选择器或 DOM 元素 |
| `apiBaseUrl` | `string` | 是 | - | API 基础地址 |
-| `postSlug` | `string` | 是 | 当前页面 URL `window.location.origin + window.location.pathname` | 文章唯一标识符 |
| `theme` | `'light' \| 'dark'` | 否 | `'light'` | 主题模式 |
| `pageSize` | `number` | 否 | `20` | 每页显示评论数 |
+头像前缀、博主邮箱和标识等信息由后端接口 `/api/config/comments` 提供,无需在前端进行配置。
+
## 实例方法
| 方法 | 说明 |
@@ -43,7 +43,4 @@
```javascript
// 动态切换主题
comments.updateConfig({ theme: 'dark' });
-
-// 切换文章
-comments.updateConfig({ postSlug: 'another-post' });
```
diff --git a/widget/index.html b/widget/index.html
index aa73f3c..68b67a8 100644
--- a/widget/index.html
+++ b/widget/index.html
@@ -129,10 +129,6 @@
-
- 这是一个演示 CWD Comments Widget 的示例页面。你可以在上方的配置面板中修改 API 地址和文章标识符, + 这是一个演示 CWD Comments Widget 的示例页面。你可以在上方的配置面板中修改 API 地址和主题, 然后点击"应用配置"按钮重新加载评论组件。