eudicots / Cactus

Static site generator for designers. Uses Python and Django templates.
BSD 3-Clause "New" or "Revised" License
3.47k stars 314 forks source link

How do get Gihub Pages working with the .build folder? #124

Open aanomm opened 9 years ago

aanomm commented 9 years ago

I'm deploying my Cactus site to Github Pages. How do I handle this considering that Cactus seems to clear all the .git files and folders from the build folder on every build?

krallin commented 9 years ago

Hi there,

Did you consider just having your GitHub pages root outside of build, and simply copying the built files over to the repo after a build is complete?

Cheers,

aanomm commented 9 years ago

I have it outside of the build folder @krallin. I have to because Github Pages require a CNAME file for custom domains, which Cactus wipes clean every build. So I am coping all the files after every change at the moment, which seems so prehistoric. I just figured there must be some automated way around this?

krallin commented 9 years ago

You could write a plugin that creates / copies the file after the build. Would that work for you?

Cheers,

aanomm commented 9 years ago

It certainly would. I've looked at default.py in the plugins folder but python is beyond me.

moomoohk commented 9 years ago

I'm dealing with the exact same setup. I'm gonna try writing something up and stick it here when I'm done.

moomoohk commented 9 years ago

Here ya go: https://gist.github.com/moomoohk/f3b114c392aae03f0cd2

The script copies everything in /.build to /build without deleting hidden files and folders (like .git and .gitignore). If you want to change the output folder change build_folder = site._path + "/build" on line 14 to build_folder = site._path + "/[whatever]".

Enjoy!