laktek / punch-blog

A boilerplate to create personal blogs based on Punch
MIT License
45 stars 14 forks source link

build GitHub Pages in the same repo #21

Closed constantx closed 11 years ago

constantx commented 11 years ago

I'm trying to use punch-blog with GitHub, and keep the source and built files in the same repo.

One way I've been doing is keep the source files under _src and make "output_dir": "../" This is ok with github pages for user/organization using {user/organization}.github.io

However, I'm not quite sure how to do the same thing, but use gh-pages to build project pages instead. Any hint?

laktek commented 11 years ago

You can create a orphaned gh-pages branch and setup a new Punch project there. Set the output_dir to the root (.).

Check the Punch's gh-pages branch to learn how to structure the project. - https://github.com/laktek/punch/blob/gh-pages

constantx commented 11 years ago

Thanks @laktek

I thought about that too, was looking for a solution that can keep the source and built files in the same repo, but in different branches.

constantx commented 11 years ago

looks like generated site are using absolute path for assets (pointing to / for css and js), so when page are built via gh-pages branch and access via username.github.io/project-name, the path is incorrect.

Anyway around this?

constantx commented 11 years ago

Also, when publishing to GitHub via gh-pages, the output folder is a subdirectory of the repo /output, is there a trick to push the content of this folder to the root of the repo on gh-pages branch?