travis.media

Why I Switched From Ghost CMS to Hugo

I just transitioned my blog from Ghost CMS over to Hugo, an open-source static site generator. In this article, I'll explain why (especially in light of moving to Ghost just a year ago).

Video version - or watch it on YouTube


Or if you prefer to read the article, read on!


Why Move Away From Ghost?

To be honest, I love Ghost. It’s fast, it’s JavaScript, and it’s an overall pleasant CMS. Just a year ago I switched from WordPress to Ghost and couldn’t be happier about it.

The story for that is here:


But there has been one nagging factor since then:

The database/backend.

Why do I even need a database or a server side language?

I mean, it’s a blog. I create content on it. I don’t have users signup or courses or anything at all that requires a backend.

And to be honest, the majority of bloggers and content creators do not need a website backend either

Okay… so what’s the alternative then?

Static Sites

Static sites.

Yes, pure HTML, CSS, and JS. NO server side language.

But who has time for that right? It’s a huge task to manage hundreds of pages. We’re 15 years past that.

Correct. But now we have… static site generators!

Examples include Gatsby, Hugo, Next.js, and Jekyll.

How they work is they will compile all your content and code into a static site for you. Just HTML, CSS and JS. And your hosting solution just serves up your static files (often for free).

There is no dynamic content.

If you change something, add a post, etc., you simply rebuild the new site and push the changes.

Benefits

So what are the benefits?

  1. More security. I mean, what’s there to hack? There’s no database. Its all static.
  2. Lightweight. It’s precompiled. Nothing on the backend to load.
  3. Easy to deploy. Just generate the static pages and upload. Easily done in an automated script. For my site, I simply push my changes to Github and it kicks off the build and updates for me.
  4. You can host for free on Netlify, Heroku, and in my case, Digital Ocean App platform (more on that in a few).

Headless Ghost?

So you might be wondering: What about headless Ghost?

Running Ghost headless means that you use Ghost primarily as a backend. You keep the DB and use the Ghost API to interact with the data. That allows you to choose your front end, like React, Vue, etc.

The problem in my specific scenario is that I just don’t need the backend.

Also I would have to pay for hosting for the backend while having my frontend somewhere else running free (sure there are Netlify CMS solutions, etc).

How it really happened (Why Hugo?)

So the idea to swap happened randomly as I came across the ghostToHugo migration GitHub repo.

On a whim I converted all my posts/pages … which led to spinning up a demo site to see if it works, which ultimately led to a working Hugo site on my local computer with all of my own content ready to roll (almost, had to tweak a bit later) in under 10 minutes.

Then that led to me looking for themes, which led to me finding one, and seeing if I could deploy it on Digital Ocean…

And speaking of Digital Ocean…

Digital Ocean App Platform

I’ve been using Digital Ocean since migrating to Ghost. I’m a big fan. (Use that link and you’ll get $100 in Digital Ocean credit. But, of course, with Hugo you won’t need it 😁)

Well I came across their new App platform which makes deploying, managing, and scaling your Apps easy.

I connected the Github repo for my Hugo site, it automatically detected Hugo, and created an appspec build file for me.

Within 5 minutes my site was up and running on the Digital Ocean App platform. I added my domain info and Digital Ocean automatically set up my SSL. I was live in no time.

Now I can write in Markdown (something I enjoy), inside of my VS Code editor (what is more beautiful?), and every time I push any new content or changes to Github a build updates my site automatically.

Conclusion

Hugo was very easy to pick up. Sure there more work to be done on the site but it was a painless transition from Ghost to Hugo (and to Digital Ocean).

@ me on Twitter with questions or suggestions.

----------

** This article may contain affiliate links. Please read the affiliate disclaimer for more details.

About Me Author

Travis of

Travis Media

From agency work with WordPress and PHP, to freelancing full-time, to jumping into the corporate space and working on large, mission-critical projects as a DevOps engineer, I create content to share what I’m learning along the way and to help you, the developer, succeed in the industry. Read More
Explore

You May Also Like