Blog systems are pretty straightforward. Just a text published in chronological order, right? But there is so much more required, which is not visible at first sight. I am using Ghost because I love the simple, easy editor! It's a dream to work with it for someone used to editors like Typora.

On the other end, WordPress got bloated over the years. A clean WordPress installation is pretty and fast. However, the PHP-Stack needs to be maintained unless you pay for it using a managed web host. Usually, a WordPress installation requires a load of plugins sooner or later. Those plugins (and themes) need to be updated. Plesk introduced a utility around WordPress a few years ago, which keeps the installation up2date. But not every automated Update runs without any flaws. Most Plugins forced me to add more and more CSS over time to fix visual glitches introduced by updates.

I just want to write down some notes for my future me

The creators announced Ghost as an easy blog. Simple. Minimal. Fast. And don't get me wrong: Much of their work is fantastic, but the are some caveats one should be aware of.

The Good

Ghost is indeed very simple. Like WordPress, you can host it yourself or use Ghost as a service. The documentation is good. The community is active, though it's not very big yet. Also, the creation of themes is well documented. Ghost uses Handlebars, so you need to get familiar with this template engine. In my opinion, that is something WordPress lacks. Looking at the origins of PHP, it's easy to arg PHP itself is already a template engine. But a template engine should reduce the logic from the view parts and put it into dedicated places - separation of concerns.

I need to admit, English is not my first language. Therefore I love to check my texts with Grammarly. It is possible, but an additional plugin is required (thanks to Shahed Nasser at this point).

The default theme Casper is free to use and already pretty sophisticated. It is an excellent theme to start developing your own if you want to. Additionally, there is a marketplace for themes, partly free, partly charged. If your vision of your blog design is not too specific (like mine was), you might find something there.

A dedicated database is possible but most often not required. SQLite does a decent job here.

The Bad

Search is not included! Yep, you read right. The maintainers suggest using third-party services/tools for it. I used GhostHunter because I want to have everything in a single docker container, without external dependencies like Google or hosted scripts. Maybe you got your hands on ElasticSearch or something similar before: Search is hard! GhostHunter provides a good compromise in my opinion, though it depends on jQuery, which is a bit old-fashioned for some use-cases.

Comments are not included! Though I could accept search is missing, a comment system can be implemented relatively simply. The Ghost maintainers suggest services like Disqus. I am not interested in using external services, as explained before. Therefore, I used Commento, a self-hosted privacy-friendly comment system.

Additionally, Varnish is a nice caching system, which can be flushed via trigger request - e.g., once you update a post. I found this guide, which became pretty handy (thx kruyt). Putting everything together in a docker-file, it might look something like this:

version: '3.1'

services:
  ghost:
    image: ghost:alpine
    container_name: ghost
    restart: always
    volumes:
     - htmlfiles:/var/lib/ghost/content:z
    environment:
      # see https://ghost.org/docs/config/#configuration-options
      PORT: 2368
      NODE_ENV: production

  
  varnish:
    container_name: varnish  
    image: varnish:stable
    restart: unless-stopped
    depends_on:
      - ghost
    ports:
      - 8888:80
    environment:
      VARNISH_MEMOR: 500m
    volumes:
	  # see https://kruyt.org/ghost-blog-caching-with-varnish/
      - ./default.vcl:/etc/varnish/default.vcl

  commento:
    container_name: commento
    image: registry.gitlab.com/commento/commento
    ports:
      - 8078:8080
    environment:
      COMMENTO_ORIGIN: "https://commento.YOURDOMAIN"
      COMMENTO_PORT: 8080
      # change this!
      COMMENTO_POSTGRES: postgres://POSTGRESUSER:PASSWORD@postgresdb:5432/commento?sslmode=disable
      COMMENTO_SMTP_HOST: mail.host
      COMMENTO_SMTP_PORT: 587
      #change to true after initial setup to avoid registration by others
      COMMENTO_FORBID_NEW_OWNERS: "false"
      COMMENTO_SMTP_USERNAME: SMTP_USERNAME
      COMMENTO_SMTP_PASSWORD: SMTP_PASSWORD
      COMMENTO_SMTP_FROM_ADDRESS: no-reply@YOURDOMAIN
    depends_on:
      - postgresdb

  postgresdb:
    container_name: postgres
    image: postgres:13-alpine
    environment:
      POSTGRES_DB: commento
      # change this!
      POSTGRES_USER: "POSTGRESUSER"
      POSTGRES_PASSWORD: "PASSWORD"
    volumes:
      - postgres_db:/var/lib/postgresql/data


volumes:
  htmlfiles: {}
  postgres_db: {} 
docker-compose.yaml for a close to production Ghost stack.

The Ugly

Handlebar helpers are functions, which abstract logic for the view parts and make them reusable. The amount of available helpers for Ghost is a bit sparse. It looks like there is no official documented way to install custom helpers. After a short search, you might find instructions like this, and it works - more or less, but it looks like Ghost does not want us to add any complex logic to the frontend. I was looking for a way to use different background images depending on the time of the day. Easy with Javascript, but as it impacts the rendering of the site, it's better to do it on the server-side.

Custom cards for the editor would also be lovely. E.g., a carousel for images. It looks like some people started with this in 2020, but from what I can tell, it did not find its way to Ghost.

Though a markdown editor exists, you are not able to add footnotes across multiple cards. The more text you write in a single card, the slower the typing is. Markdown does also not work with Grammarly. Using Latex equations does no improve the situation. The issues could be fixed by adding a way to introduce footnotes/references to normal cards. But it seems this might take a while or two.

Content management in Ghost (image provided in the Ghost doc)

Editing post batch-wise is not an option in Ghost. You want to publish several posts at once? Then you have to open each post and click on the publish button.

Conclusion

Will I stick with Ghost? At least for a year or so. The community is really active, at least from what I can tell from the forum. Let's see how it will turn out. 😎