4

So deploying to a gh-pages branch on Github with Octopress is relatively simple. It is spelled out here.

However, I already have a static site hosted on my gh-pages branch (and the source stored in the master branch).

So how do I keep my static site, while deploying my blog to just either a blog.mydomain.com or mydomain.com/blog where I am using gh-pages to manage both the Octopress blog and the static site for mydomain.com.

I also checked out these instructions for moving the blog to something to like blog/index.html...but it seems like it doesn't quite allow me to fully separate my static site from the blog. Seems like the styles may overlap and lots of other drama. I would rather keep them separate.

Is this even possible?

If not...is there a workaround to achieve what I want?

marcamillion
  • 29,563
  • 49
  • 161
  • 337

2 Answers2

1

I finally figured out the best way to do this, and I have done a thorough write-up about it here.

Hope that helps anyone else that struggles with it - the way I have.

marcamillion
  • 29,563
  • 49
  • 161
  • 337
0

By default Octopress publishes your blog to User or Organization Github Pages. I think you'd need to deploy your blog to Project Github Pages instead. See here for the description of the difference.

This would mean that you would have another branch called gh-pages.

  • Your existing static site would be on the master branch and would deploy to username.github.io.
  • Your blog would be on the gh-pages branch and would deploy to username.github.io/projectname

This sounds quite hopeful, and it may that with some carefully configured CNAME records, it may be enough.

Edit

There are instructions for deploying to Github project pages in the section With Github Project pages (gh-pages) on the deployment instructions page.

A possible alternative would be switch the locations. That is, leave the blog in the master branch (and deploy it to username.github.io) and put your existing static site in a Project page at username.github.io/projectname. Then you can setup CNAME records so that blog.mydomain.com and site.mydomain.com point to the right places.

shamp00
  • 10,504
  • 3
  • 31
  • 76
  • The issue I have with this is that the instructions are centered around `jekyll` and not `octopress` which is what I am using. – marcamillion Sep 20 '13 at 02:58
  • Octopress is built with Jekyll which is why the instructions ought to work, but you would probably have to modify the Octopress source if you go that route. Did you manage to get it published to a project page first? I think there's a good chance you don't have to make any changes anyway. – shamp00 Sep 20 '13 at 07:02
  • Actually I just realised, there are instructions on [this page](http://octopress.org/docs/deploying/github/) in the section _With Github Project pages (gh-pages)_. So you shouldn't need to modify any source. – shamp00 Sep 20 '13 at 08:10
  • Yeh...this is the default way to do any octopress installation. What I was looking for is if I have a static HTML site published on `gh-pages`, how do I then publish the octopress blog to that same `gh-pages` branch. I have since figured it out - so you don't have to stress about it. I will write up an answer shortly. – marcamillion Sep 21 '13 at 10:12