Wordpress to Hugo migration

Image showing an arrow from wordpress to hugo
Image credits: amreo, CC0

We are pleased to announce that the migration from WordPress to Hugo is now complete, both for this website and for libreschool.org, with the publication of this site.

This project is the result of a long process that began in November of last year, starting with the first commit made by Paolo Asperti on November 26, 2023, for the website LibreSchool.org, and concluding with the publication of the new bglug.it website, which went live on September 3, 2024, during the first BGLUG evening meeting after the summer break.

This achievement was made possible thanks to the contributions of several people, but the main contributor was undoubtedly Paolo Asperti, who handled the technical aspects. It is also important to mention Omar Lazzari, who played a significant role in content management.

Contributions to libreschool.org according to gitea
Image credits: none, CC0
Contributions to bglug.it according to gitea
Image credits: none, CC0

During the migration, nothing was lost. A tool was used to export the articles from WordPress and convert them into “Hugo format”, with manual adjustments made later.

The source code for both websites is public and available here for BGLUG.it and here for LibreSchool.org.

What is a static site generator?

Before talking about Hugo, it’s important to understand what a static site generator is. A Static Site Generator (SSG), is a software that takes text files (e.g. in markdown or rst format) as input and generates a website consisting of HTML, CSS, JS, images, and other files, but without any server-side executable logic (like PHP or a REST server).

Diagram showing how a generic SSG works. It illustrates how the generator takes input template files such as head.html, footer.html, and sidebar.html, along with content files like contacts.md, home.md, and product.md, and produces an output file tree containing an index.html file and two directories, each with its own index.html file.\n
Image credits: devPractical

What is Hugo?

Hugo logo
Image credits: Hugo

Hugo is one of the many free(as freedom) SSGs available on the market, and probably the most popular one. It was chosen for both of our websites because it is fast, flexible, and has a wide range of themes available. Specifically, we decided to use the hugo-arcana theme.

For us, this means that whenever we need to update the website, such as creating a new article, we simply modify the content files according to the instructions in our wiki and publish the changes to the official site repository. From there, a series of automations managed by Gitea’s CI/CD pipeline runs Hugo and uploads the generated files to the web server. These automations also ensure that the content is properly formatted and that nothing breaks.

One of the advantages of using SSGs is that they allow third parties to propose changes to the website, as long as those changes are approved by us.

Why did we migrate from WordPress to Hugo?

Wordpress is the most popular content management system and was the system we used before the migration. One of the advantages of a CMS is that it allows dynamic content management, meaning the content can change throughout the day or based on user interactions. CMSs also support features like payments, comments, and advanced user logic.

However, these advantages were not very relevant for us. Instead, the disadvantages of WordPress, such as the need for frequent updates and higher maintenance, slower loading times, and a larger attack surface (PHP + WordPress), were problematic. We had also experienced incidents where unwanted articles appeared on the site.

These were the main reasons we chose to migrate from WordPress to Hugo.

Benefits of the migration to Hugo for BGLUG

The migration to Hugo has brought numerous benefits for us, including:

  • Faster load times: The new site is significantly faster than the WordPress-based version, with much shorter load times.
  • Improved security: Without the need to manage a complex backend like PHP or MySQL databases, the attack surface of the site has been drastically reduced.
  • Simplified maintenance: Hugo requires less maintenance, eliminating the need for constant plugin and theme updates. We can be relatively confident that the website will still work perfectly even twenty years from now.
  • Simplified archiving: Archiving is much simpler because it’s automatically handled by Git. In ten years, if we want to review the old site, we just need to run git checkout and hugo server to see it as it was.

Another potential advantage is lower hosting costs, as hosting a static website is much cheaper due to its small size and the ability to host it literally anywhere, like on a CDN. However, for us, nothing has changed since the site continues to run on the same web server, which hosts other services as well.

We Want You

In conclusion, we would be very happy to receive contributions from external people as well. If you’re willing to help us, you’re more than welcome! Not only for this project but also for other BGLUG activities.

Here are some useful links to get started:

Edit me on Gitea