After a while using WordPress and hating the lack of control I finally decided to create my own blogging software.
Who knows, maybe some day this software will be useful and others will be able to reuse it, but, at least for the time being, it's for me, just hacking and trying ideas.
I used to write my posts in ERB format, but it's too complicated for what I need (static pages). The new format is Markdown converted to ERB using pandoc
.
Each article lives within the views/
folder with the following structure:
- source.md
- index.erb (Generated by pandoc)
- pictures and other assets
bin/index-posts.sh
bin/md2html.sh
Make sure you have rbenv installed.
export BLOG_PATH=<path to the repository>
cd $BLOG_PATH
gem install bundler
bundle install
unicorn -c unicorn.rb
The server will listen on port 8080: http://127.0.0.1:8080.
docker build -t blog .
docker run --rm --name myblog -p 8080:8080 -d blog
The blog is currently hosted on a Linode server behind Apache and using a Let's Encrypt certificate. The Apache config can be found in the apache/
folder. You can generate a certificate as follows:
The following assumes that you own a domain and that its A record is pointing to the your host's IP.
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --apache
# Answer the questions