1

My project is a javascript doohicky, and so the entirety of the code is in javascript/html/css. In order to host the project, I created a github page.

Is there a way for the github page to "point to" the javascript and html in my main branch?

For example: My main branch has an index.html, is there a way to tell github to use this index.html as the gh page's index page?

1 Answer 1

2

Nope, no way to do that (Google Code can do that, AFAIK). The best you can do is:

a) make the gh-pages branch a branch of master (instead of resetting it) and just git rebase the gh-pages branch to the master branch every time you make an update to the master

or,

b) make the index.html page "smart" in the way that it is hosted on the gh-pages branch but is just an empty "shell" page which fetches its content from the master branch. I imagine this could be done via an iframe that covers the entire page and points to the index.html in the master branch (thus, effectively, the iframe becomes the page). Alternately, the webpage on the gh-pages branch could dynamically fetch content from the master branch via AJAX+GitHub API, and then inject the fetched content into itself (this is just for HTML content, since scripts and styles are easily injected via and tags).

I usually take approach a) for projects that are basically webapps.

Sign up to request clarification or add additional context in comments.

1 Comment

Sounds reasonable, I'll take approach a. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.