当前位置:首页 > 编程笔记 > 正文
已解决

部署vuepress项目到githubPage

来自网友在路上 152852提问 提问时间:2023-10-28 20:12:39阅读次数: 52

最佳答案 问答题库528位专家为你答疑解惑

部署vuepress项目到githubPage

1. 项目文件夹下有两个分支(main和gh-page)

1.1 main分支存放项目代码
1.2 gh-page分支存放 npm run docs:build之后的dist里面的所有文件

2. 分别提交到github上

3. 你的项目/docs/.vuepress/config.js

   module.exports = {title: 'vuePress',description: 'VuePress GitHub Actions',base: '/yt-ui-doc/', // 必须配置正确repo: 'https://programmermao-001.github.io/yt-ui-doc/', // 远程仓库地址plugins: ['vuepress-plugin-mermaidjs'],themeConfig: {// ...}}

4. 你的项目/deploy.sh

   #!/usr/bin/env sh# 当发生错误时中止脚本set -e# 构建npm run build# cd 到构建输出的目录下cd dist# 部署到自定义域域名# echo 'www.example.com' > CNAMEgit initgit add -Agit commit -m 'deploy'# 部署到 https://<USERNAME>.github.io# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master# 部署到 https://<USERNAME>.github.io/<REPO># 将下面这行替换成自己的仓库地址git push -f git@github.com:ProgrammerMao-001/yt-ui-doc.git master:gh-pages   cd -

5. 上github.com找到自己的项目

5.1 Settings
5.2 Pages
5.3 Branch 选择 gh-page分支 / (root)文件夹
5.4 保存

6. 发布成功 例如我的

查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"部署vuepress项目到githubPage":http://eshow365.cn/6-27056-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!