Ghost on Github
You probably noticed that I'm using Ghost on GitHub, even though Ghost does not run on GitHub. If you don't know Ghost you should check it out now!
Setting up a local Ghost
I strongly recommend using Docker if you can! With docker installed you simply run
docker run -d --name github-blog -v <local-path>:/var/lib/ghost -p 2368:2368 ghost
This starts a new Docker container serving on 2368 named github-blog of ghost. All your data will be stored at <local-path>
. With this Docker container you should use the standard 2368 port as some of Ghosts links will point nowhere otherwise (it strangly uses the server port and not the one the users uses).
After this setup you can simply go to localhost:2368/ghost
and start editing your blog.
Mirroring with wget
At last you want to copy your files to GitHub. I use wget for this, which is essentially wget localhost:2368
. But sadly it is not quite that simple, you want it to follow links and change some of them according to the file-type to avoid MIME conflicts etc. You can find my mirror script here. But: Be careful running this script. It removes everything in the current folder before starting wget. It will remove your files without asking and without putting it into the trash!