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 itdist
directory is not created. Also changes will appear on gh-pages only after they are added and pushed to the subtree.dist
from.gitignore
filegrunt build
in consolegit add dist && git commit -m "Initial dist subtree commit"
git subtree push --prefix dist origin gh-pages
All of your answers can be found here!
In a nutshell, you will generate the deployment-ready version of your site. You do this by running
grunt
. That will generate the optimized, production site in a folder calleddist
. You will then push the contents ofdist
directly togh-pages
.A frequent contributor to Yeoman also made this task: grunt-build-control, which will let you simply run something like
grunt deploy
.