diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 091df03..39bb50b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,7 +11,7 @@ jobs: uses: jenkey2011/vuepress-deploy@master env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} - TARGET_REPO: anghunk/CWD + TARGET_REPO: anghunk/cwd TARGET_BRANCH: gh-pages BUILD_SCRIPT: yarn --cwd docs && yarn --cwd docs build BUILD_DIR: docs/.vitepress/dist/ diff --git a/README.md b/README.md index 7f53408..4dca8ce 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > > 目前处于内测阶段,欢迎参与测试。 - + # CWD (Cloudflare Workers Discuss) diff --git a/cwd-admin/index.html b/cwd-admin/index.html index 791f441..7b35687 100644 --- a/cwd-admin/index.html +++ b/cwd-admin/index.html @@ -4,7 +4,7 @@ - CWD 评论后台 diff --git a/cwd-admin/src/views/LayoutView.vue b/cwd-admin/src/views/LayoutView.vue index 9c2525c..7e87697 100644 --- a/cwd-admin/src/views/LayoutView.vue +++ b/cwd-admin/src/views/LayoutView.vue @@ -20,7 +20,7 @@ 使用文档 - + Github @@ -156,7 +156,7 @@ function openDocs() { } function openGithub() { - window.open("https://github.com/anghunk/CWD", "_blank"); + window.open("https://github.com/anghunk/cwd", "_blank"); closeActions(); } diff --git a/cwd-api/src/index.ts b/cwd-api/src/index.ts index edcdf5c..df554c2 100644 --- a/cwd-api/src/index.ts +++ b/cwd-api/src/index.ts @@ -206,7 +206,7 @@ app.use('/admin/*', async (c, next) => { app.get('/', (c) => { return c.html( - `CWD 评论部署成功,当前版本 ${VERSION},查看文档` + `CWD 评论部署成功,当前版本 ${VERSION},查看文档` ); }); diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index 49dd8df..3be47d2 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -12,7 +12,7 @@ export default defineConfig({ 'link', { rel: 'icon', - href: 'https://github.com/anghunk/CWD/blob/main/icon.png?raw=true', + href: 'https://github.com/anghunk/cwd/blob/main/icon.png?raw=true', }, ], ], @@ -24,10 +24,10 @@ export default defineConfig({ label: 'On this page', }, editLink: { - pattern: 'https://github.com/anghunk/CWD/blob/main/docs/:path', + pattern: 'https://github.com/anghunk/cwd/blob/main/docs/:path', text: '在 GitHub 上编辑此页面', }, - socialLinks: [{ icon: 'github', link: 'https://github.com/anghunk/CWD' }], + socialLinks: [{ icon: 'github', link: 'https://github.com/anghunk/cwd' }], lastUpdated: true, lastUpdatedText: '最后更新于', diff --git a/docs/.vitepress/configs/nav.js b/docs/.vitepress/configs/nav.js index 740d417..f4e6c57 100644 --- a/docs/.vitepress/configs/nav.js +++ b/docs/.vitepress/configs/nav.js @@ -1,5 +1,5 @@ export default [ { text: '首页', link: '/' }, - { text: '部署文档', link: '/guide/backend-config' }, + { text: '快速开始', link: '/guide/backend-config' }, { text: 'API 文档', link: '/api/overview' }, ]; diff --git a/docs/guide/frontend-config.md b/docs/guide/frontend-config.md index 2a63a1d..f5be5e7 100644 --- a/docs/guide/frontend-config.md +++ b/docs/guide/frontend-config.md @@ -12,7 +12,7 @@ @@ -45,24 +45,28 @@ | `updateConfig(config)` | 更新配置(支持动态切换主题等) | | `getConfig()` | 获取当前配置 | -## 使用示例 +**使用示例** ```javascript // 动态切换主题 comments.updateConfig({ theme: 'dark' }); ``` -### 博客程序使用示例 +## 其他框架示例 + +如果你有其他博客框架的需求,欢迎在下方评论区留言。 ### HTML +此方法适用于绝大多数博客框架,包括 Hexo、Hugo、Jekyll、WordPress 等。 + ```html
@@ -77,9 +81,55 @@ comments.updateConfig({ theme: 'dark' }); document.addEventListener('DOMContentLoaded', () => { const comments = new window.CWDComments({ el: '#comments', - apiBaseUrl: 'https://your-api.example.com', + apiBaseUrl: 'https://your-api.example.com', // 换成你的 API 地址 }); comments.mount(); }); ``` + +### Vue + +在 Vue 单文件组件里封装。 + +`CommentsWidget.vue`: + +```html + + + +``` diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 617a772..cb7f7d5 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -39,7 +39,7 @@ CWD 评论系统。 ```bash # 克隆项目 -git clone https://github.com/anghunk/CWD +git clone https://github.com/anghunk/cwd # API 项目 cd cwd-api diff --git a/docs/index.md b/docs/index.md index 7a01240..8b4ffb2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,7 @@ hero: name: CWD 评论系统 tagline: 基于 Cloudflare Workers 与全球边缘网络的免服务器、极速安全、即插即用评论系统。 image: - src: https://github.com/anghunk/CWD/blob/main/icon.png?raw=true + src: https://github.com/anghunk/cwd/blob/main/icon.png?raw=true alt: 文档封面 actions: - theme: brand