正在尝试部署此文档:
https://github.com/aitormendez/democracia/tree/master/docs
至GitHub页面:https://aitormendez.github.io/democracia/
我在local dev和Github中得到了一些不同的东西。
这是在本地开发中的外观:

这是对GithHub的观察:

另外,.vuepress/dist/index.html看起来像这样:

这是config.js:
https://github.com/aitormendez/democracia/blob/master/docs/.vuepress/config.js
module.exports = {
home: true,
title: 'Democracia. Manual de uso web',
base: '/democracia/',
themeConfig: {
nav: [
{text: 'Democracia', link: 'https://democracia.com.es'}
],
sidebar: [
{
title: 'Contenido',
collapsable: false,
children: [
'/',
'front-page',
]
},
]
}
}package.json:
https://github.com/aitormendez/democracia/blob/master/package.json
{
"devDependencies": {
"vuepress": "^1.4.1"
},
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
}
}和deploy.sh
#!/usr/bin/env sh
set -e
npm run docs:build
cd docs/.vuepress/dist
git init
git add -A
git commit -m 'deploy'
git push -f git@github.com:aitormendez/democracia.git master:gh-pages
cd -AFAIK,我遵循了部署到Github的步骤:https://vuepress.vuejs.org/guide/deploy.html#github-pages
我做错了什么?
发布于 2021-05-16 03:01:51
也有类似的问题。您需要在docs/.vuepress/config.js中设置正确的基础。假设您的存储库位于https://github.com/[USERNAME]/[REPO],那么您需要将基础设置为"/REPO/“。换句话说,当你访问Settings>Pages时,你会看到一条消息:“你的站点发布在https://xxxxxx77.github.io/xxxxxGuide/"上--你需要将/xxxxxGuide/设置为你的基础。
这是我的config.js的样子:
module.exports = {
title: 'xxxxx',
description: 'xxxxxx',
base: "/xxxxGuide/"
}发布于 2020-04-27 21:48:48
github选项错误。有必要指定gh-pages分支作为源。

https://stackoverflow.com/questions/61455410
复制相似问题