WPSurfer.com

WordPress Alternatives: Exploring Hugo SSG

Published on December 18, 2024 | Updated on January 13, 2025

When I migrated my websites from Cloudways to Digital Ocean with CloudPanel, I used Python scripts to convert all my WordPress sites into static sites.

After that, I figured out how to integrate GitHub and Cloudflare Pages into my workflow, so I don’t have to manage a server now.

Since I like learning new stuff and speed up processes working locally, I decided to give Hugo static site generator a try.

Hugo builds HTML files from templates and content files, resulting in a set of static files (HTML, CSS, JavaScript, images) that can be deployed to any web server.

This is everything you need to learn about Hugo in case you want to consider as alternative to WordPress



How is Hugo Different from WordPress?

These are some good reason to switch from WordPress to Hugo

  • Hugo generates static files. No database needed.
  • WordPress dynamically generates pages using a database
  • Hugo sites can be hosted anywhere (Netlify, GitHub Pages, Cloudflare Pages).
  • WordPress Requires a server with PHP and a database (e.g., Bluehost, WP Engine).
  • Hugo sites Highly secure since there’s no database or backend.
  • WordPress websites are more vulnerable to attacks due to dynamic processing and plugins.
  • Hugo is best for blogs, landing pages, documentation sites.
  • WordPress is best for e-commerce, membership sites, and complex applications.

Do WordPress Users Need Hugo?

Are you happy with WordPress?

If you do and turn your Local WordPress Website into a static website using static site generator plugins or Python Scripts, you could easily win the argument that there is no need to learn how to create websites with Hugo.

  • My local database runs locally so I am not worried at all about its performance.
  • My static WordPress websites use a local database so there is nothing to hack.
  • I host my WordPress static sites on CloudFlare pages. I pay $0 dollars to do that.

I use a free theme customized using a child theme and a few Mu-Plugins.

Do I really need to consider static site generators?

No, I don’t

Having said that, I don’t mind learning about Hugo and know that I don’t have to install WordPress for a simple website or blog.

Let’s get started


How to Install Hugo on Mac

There are many ways to install application on your computer, the most common one requires to visit a page, download the app compatible with Mac and start the installation process.

You can save some time by using Homebrew

Homebrew is a popular open-source package manager for macOS that simplifies the installation of software and libraries by allowing users to install them directly from the terminal.

If you are not sure if your computer has it installed, open the terminal and run this command:

brew --version

If you don’t have Homebrew installed, open the terminal and run this command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Now install Hugo using this command

brew install hugo

How to Create a Hugo Website

If you want to build sites with Hugo, you need to know the basic terminal commands

Open a terminal, go to the folder where you want to create the website and run:

hugo new site my-website

Replace my-website with the name you want for your site.

You will get this terminal message when the creation of the website has been completed

Congratulations! Your new Hugo site was created in /Users/Test/Desktop/sites/my-website.
Just a few more steps...
1. Change the current directory to /Users/Test/Desktop/sites/my-website.
2. Create or install a theme:
   - Create a new theme with the command "hugo new theme <THEMENAME>"
   - Or, install a theme from https://themes.gohugo.io/
3. Edit hugo.toml, setting the "theme" property to the theme name.
4. Create new content with the command "hugo new content <SECTIONNAME>/<FILENAME>.<FORMAT>".
5. Start the embedded web server with the command "hugo server --buildDrafts".
See documentation at https://gohugo.io/.

How to Start the Development Server

Open the terminal, go to the folder where your Hugo site is.

Run the following command to start the development server:

hugo server

Visit https://localhost:1313 in your browser to view the site.


Manuel Campos

Manuel Campos

I am José Manuel. I am writing about things I know and things that I am learning about WordPress. I hope you find the content of this blog useful.