diff --git a/.gitea/workflows/dev.yaml b/.gitea/workflows/dev.yaml index 17f2fa6..b3c6fdf 100644 --- a/.gitea/workflows/dev.yaml +++ b/.gitea/workflows/dev.yaml @@ -42,6 +42,7 @@ jobs: permissions: contents: read deployments: write + pull-requests: write steps: - name: 🚚 Checkout uses: actions/checkout@v4 @@ -66,8 +67,26 @@ jobs: run: pnpm run docs:build - name: 🚀 Deploy to Cloudflare Pages + id: deploy uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy ./src/.vuepress/dist --project-name=jingji-spbook \ No newline at end of file + command: pages deploy ./src/.vuepress/dist --project-name=jingji-spbook + + - name: 💬 Comment on PR + if: github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + const deployUrl = process.env.DEPLOY_URL; + const commentBody = `🚀 Documentation preview deployed to: [${deployUrl}](${deployUrl})`; + + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: commentBody + }); + env: + DEPLOY_URL: ${{ steps.deploy.outputs.deployment-url }} \ No newline at end of file diff --git a/README.md b/README.md index 8ccb5dc..fa5765e 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,29 @@ 1. 依赖环境 - Node.js v20.11.0 - volta -1. 建议使用 [volta](https://volta.sh/) 安装 [Node.js](https://nodejs.org/) + +2. 建议使用 [volta](https://volta.sh/) 安装 [Node.js](https://nodejs.org/) ```sh volta install node@20 ``` -2. 安装依赖 +```sh +volta install pnpm +``` + +3. 安装依赖 ```sh pnpm i ``` -3. 本地预览 +4. 本地预览 ```sh pnpm run docs:dev ``` -4. 构建静态页面。构建完成的网页会保存在 ``src\.vuepress\dist`` +5. 构建静态页面。构建完成的网页会保存在 ``src\.vuepress\dist`` ```sh pnpm run docs:build ``` + +6. 更新依赖 +```sh +pnpm dlx vp-update +``` \ No newline at end of file diff --git a/src/.vuepress/navbar.ts b/src/.vuepress/navbar.ts index 28317d4..25df3ae 100644 --- a/src/.vuepress/navbar.ts +++ b/src/.vuepress/navbar.ts @@ -4,10 +4,11 @@ export default navbar([ "/", { text: '高三特刊', + icon: "book", children: [ - { text: "2022级特刊", link: '/2022/' }, - { text: '2021级特刊', link: '/2021/' }, - { text: '2020级特刊', link: '/2020/' }, + { text: "2022 级特刊", link: '/2022/' }, + { text: '2021 级特刊', link: '/2021/' }, + { text: '2020 级特刊', link: '/2020/' }, ] } ]); diff --git a/src/.vuepress/sidebar.ts b/src/.vuepress/sidebar.ts index 03f1b7c..8783202 100644 --- a/src/.vuepress/sidebar.ts +++ b/src/.vuepress/sidebar.ts @@ -8,21 +8,21 @@ export default sidebar({ link: "introduce.md" }, { - text: "2022级特刊", + text: "2022 级特刊", prefix: "2022/", link: "2022/", children: "structure", collapsible: true }, { - text: "2021级特刊", + text: "2021 级特刊", prefix: "2021/", link: "2021/", children: "structure", collapsible: true }, { - text: "2020级特刊", + text: "2020 级特刊", prefix: "2020/", link: "2020/", children: "structure", diff --git a/src/.vuepress/styles/config.scss b/src/.vuepress/styles/config.scss index d55649d..15e3186 100644 --- a/src/.vuepress/styles/config.scss +++ b/src/.vuepress/styles/config.scss @@ -1,2 +1,2 @@ // you can change config here -$theme-color: #096dd9 !default; +$theme-color: #096dd9; diff --git a/src/.vuepress/theme.ts b/src/.vuepress/theme.ts index 343232c..fbaf956 100644 --- a/src/.vuepress/theme.ts +++ b/src/.vuepress/theme.ts @@ -28,15 +28,17 @@ export default hopeTheme({ footer: "高三特刊", displayFooter: true, - - // page meta - metaLocales: { - editLink: "在 Gitee 上查看此页", - }, + pageInfo: ["Category", "Tag"], plugins: { icon: { assets: "fontawesome" }, - + git: { + contributors: false, + changelog: { + maxCount: 5, + repoUrl: "https://gitea.lionhao.top/jjnwxs/jingji_spbook", + } + } }, markdown: { include: true, diff --git a/src/introduce.md b/src/introduce.md index d1b13d0..5892c2c 100644 --- a/src/introduce.md +++ b/src/introduce.md @@ -17,6 +17,6 @@ index: false ### 2024.2.12 - 迁移 [VuePress Theme Hope](https://theme-hope.vuejs.press/zh/) 至 V2 -- 关闭打印按钮/Github 相关信息显示 -- 更新主页版权信息 -- 修复导航栏图标不显示 +- 关闭打印按钮以及 Github 相关信息显示 +- 更新首页版权信息 +- 修复浏览器导航栏图标不显示的问题