Quick and free ghost blog hosting
Ghost is an opensource blogging platform, with beautifully simplistic themes (this website uses the default theme) and handy markdown editing with realtime preview. It is also free if you are willing to download and host it yourself. Ghost is written in javascript and runs on nodejs.
Github pages is a free platform that allows you to publish your static website by just pushing to a github repository. I have noticed significant site response gain after I moved from ghost pro to github pages, and also I get the goodness of github backup for my blog.
In this recipe (written with mint 17.2) we setup ghost locally, and create our blog. We then use buster, a python utility which takes in any hosted website's base url, and generates the equivalent static pages and resources, and pushes them to our github pages repo.
Setup ghost
# Create a directory to store your ghost blog content
sudo mkdir /var/www/ghost
Only a few months ago ghost published their official dockerfile, so you can just run ghost in a container as below.
docker run -d --name myblog -p 8080:2368 \
-v /var/www/ghost:/var/lib/ghost ghost
Here 8080 is the port on your localhost where you want to access the blog. You link the local volume /var/www/ghost
so that your changes aren't lost when the container stops.
That's it, browse to localhost:8080
to access your blog. You can manage your blog at localhost:8080\ghost
.
Setup Github pages with buster
Login to your github account and create a public repo by the name <accountname>.github.io
.
Install buster.
pip install buster
Create a separate directory for the static site generated by buster. From within this directory, run:
# Run below command and enter your github repo url when prompted
buster setup
# To generate the static files (with your ghost container running)
buster generate --domain=http://localhost:8080
Add, commit and push the changes to github to see your website updated at <accountname>.github.io
.
Note: If you want your domain to point to your github pages website, add a file to your repo named CNAME
with a single line containing your domain name. Also update your domain's DNS record and you are set.