Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 1.54 KB

README.md

File metadata and controls

55 lines (42 loc) · 1.54 KB

Blog

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.

Article format

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

Index all posts

bin/index-posts.sh

Convert all posts to ERB

bin/md2html.sh

How to run locally

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.

Run on a docker container

docker build -t blog .
docker run --rm --name myblog -p 8080:8080 -d blog

Production

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