有可能改变github页面寻找index.html的位置? [英] possible to change where github pages looks for index.html?

查看:674
本文介绍了有可能改变github页面寻找index.html的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由yeoman的 generator-angular 生成的网站,我想用github页面发布这个网站。我创建了 gh-pages 分支,但是我的回购没有出现在 myusername.github.io/myreponame 我认为原因是因为 index.html 位于 app / 目录中,而不是根目录。


app /
| - index.html
| - scripts /
dist /
Gruntfile.js
等..



我可以告诉github页面加载索引.html从应用程序文件夹?如何启动一个网站生成W /角生成器的网页?

运行 grunt生成非常重要,因为没有它 dist 目录没有被创建。只有在添加并推送到子树后,这些更改才会出现在gh页面上。


  1. .gitignore dist $ c $ file

  2. 在控制台中运行 grunt build
  3. dist目录需要添加到GitHub。在控制台中运行此命令: git add dist&& git commit -mInitial dist subtree commit

  4. 然后将子树推送到gh-pages分支: git subtree push - -prefix dist origin gh-pages


I have a site generated with yeoman's generator-angular and I'd like to publish this site using github pages. I create the gh-pages branch but my repo does not show up in myusername.github.io/myreponame I think the reason is because index.html is in the app/ directory not the root.

app/ |-- index.html |-- scripts/ dist/ Gruntfile.js etc..

Can I tell github pages to load index.html from the app folder? How can I launch a site generated w/ angular-generator to gh pages?

解决方案

Running grunt build is important as without it dist directory is not created. Also changes will appear on gh-pages only after they are added and pushed to the subtree.

  1. Remove dist from .gitignore file
  2. Run grunt build in console
  3. After the project is built the dist directory needs to be added to the GitHub. Run this command in console: git add dist && git commit -m "Initial dist subtree commit"
  4. And then push the subtree to the gh-pages branch: git subtree push --prefix dist origin gh-pages

这篇关于有可能改变github页面寻找index.html的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆