我在使用 vue-cli v3.0 部署 Vue 应用程序构建时遇到了一些麻烦。到 GitHub 页面。我使用子树dist将文件夹仅发送到gh-pages分支。首先,问题是找不到资产,但我使用baseUrlon修复了它vue.config.js。现在的问题是该#app元素为空。我发现如果我不使用vue-router(直接渲染视图而不是使用<router-view/>),该应用程序可以在 GitHub 页面上正常工作。我相信路线选项存在一些问题path,但我无法弄清楚如何解决它。
有问题的存储库是https://github.com/guizoxxv/vue-cli-deploy,GitHub 页面链接是https://guizoxxv.github.io/vue-cli-deploy/
谢谢。
我在 React Create App 文档中讨论了有关使用 HTML5 PushState 历史 API 的路由器如何在静态文件服务器上失败而不将其配置为每次都提供服务 index.html 的问题。使用 github 页面时如何解决此问题?另外,我没有使用 Create React App 或 React-scripts
我尝试向 BrowserRouter 组件添加基本名称
<BrowserRouter basename={process.env.PUBLIC_URL}>
Run Code Online (Sandbox Code Playgroud)
这里对问题有更好的解释:
我有一个 GitHub 页面,其中包含我的简历。Github 将 Jekyll 页面呈现为 HTML,生成网站https://emanuelfontelles.github.io/cv/。
如何使用 pandoc 甚至 Jekyll 将此网页转换为 pdf?
我有一个简单的 Angular7 应用程序,它只有两条路线,主要是“文章”。如果你在本地测试它,它会起作用,但是当你放到 github 页面上时,它只会加载页面的 css。我按照文档中的角度文档进行了部署,并且还尝试了 gh-pages 工具。但它们都不起作用。如果我删除我的路线它就会起作用。
这是我在控制台上遇到的错误。
1 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'blogfolio'
Error: Cannot match any routes. URL Segment: 'blogfolio'
at t.noMatchError (main.5443131190bc79920d7b.js:1)
at e.selector (main.5443131190bc79920d7b.js:1)
............
rodnorm.github.io/:1 Failed to load resource: the server responded with a status of 404 ()
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
应用程序.routing.ts
import { MainComponent } from './main/main.component';
import { ArticleComponent } from './article/article.component';
import { Routes } from "@angular/router";
export const routes: Routes = [ …Run Code Online (Sandbox Code Playgroud) 我是角度新手。我最近将一个示例网页部署到了 Github Pages。我部署成功,但本地主机上可见的图像没有显示。相反,我在控制台上登录了 404。
这是包含以下内容的组件img:
home.component.html :
<div>
<img src='assets/images/birthday.jpg' alt='Happy Birthday' width="385px"/>
</div>
Run Code Online (Sandbox Code Playgroud)
我的目录结构是:
|src
|--app
|--assets
|---images
|----birthday.jpg
Run Code Online (Sandbox Code Playgroud)
文件夹中的目录结构dist为:
|dist
|--happy-birthday
|--assets
|---images
|----birthday.jpg
Run Code Online (Sandbox Code Playgroud)
我正在使用angular-cli-ghpages包进行部署。我的角度版本是10.0.14.
我已Angular在页面上部署了我的网站GitHub,但遇到了问题。
以下是我的route设置:
const routes: Routes = [
{ path: '', redirectTo: 'main', pathMatch: 'full' },
{ path: 'main', component: AppMainComponent }
];
Run Code Online (Sandbox Code Playgroud)
以下是我的部署命令:
- name: Build
run: |
npm install -g @angular/cli
npm install
ng build --prod --base-href=https://[user-name].github.io/[project-name]/
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: master
BRANCH: gh-pages
FOLDER: dist/[project-name]
Run Code Online (Sandbox Code Playgroud)
如果我转到我的GitHub页面“https://[user-name].github.io/[project-name]/”,它工作正常并重定向到“https://[user-name].github.io” /[项目名称]/main”成功。但是当我单击浏览器的重新加载按钮后,它404 page not found向我显示了。
我的 Angular 版本是 9.1.8。
谢谢!
我正在github上开发一个python包。在 github 的一个组织下,我有两个存储库myorg/package和myorg/documentation. 该package存储库包含 python 包和构建 sphinx 文档的方法,并documentation包含通过 github 页面发布的生成的静态 html。
我现在正在设置一个 github 操作工作流程来构建文档,并通过将发布标签推送到存储库来将package其推送到触发,但我在推送到存储库时遇到了问题。documentationpackagedocumentation
理想情况下,我希望将提交标记为由机器人进行,并且我希望所有拥有两个存储库推送权限的人都能够运行工作流程。
这是我当前的工作流程:
name: Deploy
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: package
- uses: actions/checkout@v2
with:
repository: myorg/documentation
path: documentation
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Github Pages 中托管我的 React 应用程序。
我对基于 Vue 的项目做了同样的事情,没有出现任何问题,但使用 React 时,情况有所不同。
我已经阅读了以下教程:
我能够将应用程序部署到 Github Pages,但看到以下错误:
清单:行:1,列:1,语法错误。
是的,我的清单位于我的公共文件夹中,但我不知道问题源自何处。我尝试阅读与该主题相关的各种问题,但没有找到任何相关的内容。
我还尝试创建一个普通的 React 项目并遵循教程,但遇到了同样的问题。
这是我的 package.json 文件:
{
"name": "Random App Name",
"homepage": "https://github.com/TomerPacific/projectName",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "react-scripts start",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [ …Run Code Online (Sandbox Code Playgroud) 我目前有以下 Git 存储库: https://github.com/SebastianGode/ansible-collection-cloud/tree/gh-pages 和 GitHub 页面链接: https://sebastiangode.github.io/ansible-collection-cloud /
问题是 GitHub Pages 只会解决 index.html 并对所有必需的 css 和图像内容抛出 404 错误:

由于文档是由 travis-ci 管道自动生成的,因此可能无法更改路径,但由于它在本地托管时可以工作,因此也应该可以在 GitHub 页面上工作。
这个问题有什么解决办法吗?
有什么办法可以在 github 页面中运行 python 吗?特别是通过Pyodide,因为我正在使用 pandas。我知道 github 页面仅用于使用 HTML/CSS/JS 提供静态页面,但我想知道 pyodide 是否有解决方法,因为它是用 Javascript 编译的。
我正在尝试构建一个小型 Web 应用程序,它有一个用户名输入框,一旦提交,就会从 API 调用一些数据,在 pandas 中处理并显示一些可视化效果(使用 Chart.js 或 Zingcharts 等 JS 库,或者使用 matplotlib /西博恩)
github-pages ×10
angular ×3
github ×2
html ×2
javascript ×2
reactjs ×2
angular7 ×1
git ×1
jekyll ×1
pandoc ×1
parceljs ×1
pyodide ×1
python ×1
react-router ×1
travis-ci ×1
vue-cli ×1
vue-router ×1
vue.js ×1