Stan's blog Thanks for stopping by.
Posts with the tag ghost:

Adding native image lazy-loading to Ghost with a Cloudflare Worker

In my recent post about Street Photography in South Korea, I embedded many high-res pictures. The total size of the page is about 40 MB, which is a bit much to load right away.

Adding syntax highlighting to Ghost with highlight.js

After my recent relooking, I finally took the time to add syntax highlighting for code snippets.

While Ghost doesn’t support code syntax highlighting out the box, it lays down the groundwork for it.

Moving to a new domain name

Following my recent design revamp, I took the opportunity to do another major change: migrate my blog to a new domain name. If you’re reading this you’re probably not coming from a search engine and probably know me and my work at least little. I started blogging in 2014 when I was still in high school. At that time, I was writing in french on angristan.fr. Two years ago, I decided to be more coherent with the fact that English is ubiquitous in my life and moved here to write in English.

A new look

Two years ago, when I introduced my custom theme, I said I was still considering using another theme. I didn’t find anything that fit my taste for a while, but the time has finally come! As a refresher, since I started this blog I have been running my fork of the default Ghost theme. It is open-source an available on GitHub. The default theme is great and well maintained. Since 2018, the theme has evolved quite a lot, so I updated the original post with an addition screenshot I took yesterday, if you’re curious.

Deploying a Ghost theme with GitHub actions

As of now, I am still running my custom Ghost theme, although I plan on changing it soon. (Edit: I did). It’s open-source and available on GitHub at angristan/Casper-XYZ. I update it regularly and keep it synced with the original Casper theme. A few months ago, the Ghost team came up with action-deploy-theme, an GitHub action to deploy a theme to a Ghost website automatically, right from GitHub! I have been enjoying it for a while now, so let me share how it works.

How to migrate Ghost (and Isso) to dated permalinks

I’ve never used date in my blog posts URLs because I thought it looked nicer and was better for SEO. Recently, I changed my mind and I find it better to have the date in the permalink. Not necessarily as precise as to put the day, but as least the year and month. What I want to achieve is this: https://angristan.xyz/understand-k8s/ -> https://angristan.xyz/2020/01/understand-k8s/ Ghost once had a toggle in the settings to enable dated permalinks, but it’s gone now and it’s off by default.

Migrating Ghost from SQLite to MySQL

I’ve been using Ghost with SQLite for a year and a half and I haven’t had any issues related to SQLite at all. I would even say this is a very good choice for Ghost and I realize now that I’ve made a post about it. I want to switch back to MySQL because I feel more confident using it. Especially for backups. My current setup is a LXD host server with a bunch of containers managed by Ansible.

Caching Ghost with Nginx

Ever since I started this blog I have been using Nginx as a reverse proxy for Ghost. Ghost is in a kind of weird place between real static and headless CMS like Hugo or Jekyll and fully-fledged CMS like WordPress. Ghost is a Node.js program based on Express that binds to a port and listen to HTTP requests, so it’s not deployable like a static website with only static files.

Migrating Ghost to Docker

In my first post I said I installed Ghost with ghost-cli, the classic way. I did also say that I wanted to run it in Docker but that I didn’t know Docker enough to do it. In fact, I tried to set up Ghost in Docker a few times while being bored at school, but I didn’t succeed, so it ended up like it is now. For the past week though, I’ve been learning and using Docker a lot, and finally moved a dozen services into containers.

Migrating Ghost from MySQL to SQLite

In my first post, I said that I set up my Ghost blog with a MySQL database. Why is that? Because ghost-cli wants you to use a MySQL database and I happened to have a MariaDB server on my VM and so I just added another database to it SQLite is a better choice However, Ghost supports SQlite as a storage backend. In fact, SQLite can handle more load than this blog could ever have, considering I use Nginx cache on my reverse proxy.