Skip to content

Commit

Permalink
feature 评论系统
Browse files Browse the repository at this point in the history
  • Loading branch information
zds-s committed Oct 11, 2024
1 parent 242b3b7 commit 3051d0b
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 65 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
run: |
pnpm run build
scp -i ~/.ssh/id_rsa -P ${{ secrets.SERVER_PORT }} -r .vitepress/dist/ ${{ secrets.SSH_USER }}@${{ secrets.SERVER_HOST }}:/opt/www/doc-v3/
if [ $? -ne 0 ]; then
echo "Upload failed"
exit 1
fi
echo "Upload successful"
if [ $? -ne 0 ]; then
echo "Upload failed"
exit 1
fi
echo "Upload successful"
2 changes: 1 addition & 1 deletion .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ export default defineConfig({
}
},
srcDir: 'docs',
lastUpdated: true,
lastUpdated: true
})
21 changes: 21 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import MaTable from '@mineadmin/table/dist/index.umd.js'
import MaSearch from '@mineadmin/search/dist/index.umd.js'
import MaForm from '@mineadmin/form/dist/index.umd.js'
import MaProTable from '@mineadmin/pro-table/dist/index.umd.js'
import giscusTalk from 'vitepress-plugin-comment-with-giscus';
import { useData, useRoute } from 'vitepress';

// maTable样式
import '@mineadmin/table/dist/style.css'
Expand All @@ -43,6 +45,25 @@ import './styles/vp-code-group.css'


export default {
setup(){
const { frontmatter } = useData();
const route = useRoute();
// giscus配置
giscusTalk({
repo: 'mineadmin/mineadmin', //仓库
repoId: 'MDEwOlJlcG9zaXRvcnk0MjQ2MDA5', //仓库ID
category: 'Q&A', // 讨论分类
categoryId: 'DIC_kwDOAEDJ-c4CR7vK', //讨论分类ID
mapping: 'pathname',
inputPosition: 'bottom',
lang: 'zh-CN',
},
{
frontmatter, route
},
true
);
},
enhanceApp(ctx: EnhanceAppContext) {
const { app } = ctx;
app.use(ElementPlus, { locale: zh })
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"devDependencies": {
"vitepress": "^1.4.0",
"vitepress-plugin-comment-with-giscus": "^1.1.15",
"vitepress-plugin-group-icons": "^1.2.4"
}
}
Loading

0 comments on commit 3051d0b

Please sign in to comment.