有可能改变github页面寻找index.html的位置? [英] possible to change where github pages looks for 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页面上。 - 从
.gitignore $ c删除
dist
$ c $ file - 在控制台中运行
grunt build
- dist目录需要添加到GitHub。在控制台中运行此命令:
git add dist&& git commit -mInitial dist subtree commit
- 然后将子树推送到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.
- Remove
dist
from.gitignore
file - Run
grunt build
in console - 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"
- And then push the subtree to the gh-pages branch:
git subtree push --prefix dist origin gh-pages
这篇关于有可能改变github页面寻找index.html的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!