diff --git a/content/posts/2024/2024-09-09-migrazione-wordpress-hugo/index.en.md b/content/posts/2024/2024-09-09-migrazione-wordpress-hugo/index.en.md index 3668b50..c0318c4 100644 --- a/content/posts/2024/2024-09-09-migrazione-wordpress-hugo/index.en.md +++ b/content/posts/2024/2024-09-09-migrazione-wordpress-hugo/index.en.md @@ -1,5 +1,5 @@ --- -title: "Migrazione da Wordpress a Hugo" +title: "Migrazione from Wordpress to Hugo" date: 2024-09-09T07:50:41+02:00 #expiryDate: # set this if the post should be removed automatically some time in the future #publishDate: # set this if the post should be published automatically some time in the future @@ -7,10 +7,60 @@ draft: false slug: "2024-09-09-migrazione-wordpress-hugo" type: post image: wordpress-to-hugo.png # if you don't specify an image, the first available is used -image_alt: description of the featured image. The image ratio should be 360x250. -summary: If not present, the content will be used instead +image_alt: "Image showing an arrow from wordpress to hugo" +summary: Storytelling and details of the migration from Wordpress to Hugo. tags: - news categories: - News ---- \ No newline at end of file +--- + +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](https://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](contributi-libreschool.org.png) +![Contributions to bglug.it according to gitea](contributi-bglug.it.png) + +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](https://git.libreschool.org/BgLUG/bglug.it) for BGLUG.it and [here](https://git.libreschool.org/LibreSchool/libreschool.org) 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)](https://en.wikipedia.org/wiki/Static_site_generator), 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. +](static-site-generator.png) + +## What is Hugo? + +![Hugo logo](hugo-logo-wide.png) + +[Hugo](https://gohugo.io/) 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](https://themes.gohugo.io/themes/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](https://git.libreschool.org/BgLUG/bglug.it/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](https://wordpress.com/it/) is the most popular [content management system](https://it.wikipedia.org/wiki/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. diff --git a/content/posts/2024/2024-09-09-migrazione-wordpress-hugo/index.it.md b/content/posts/2024/2024-09-09-migrazione-wordpress-hugo/index.it.md index cd222a8..7269c4d 100644 --- a/content/posts/2024/2024-09-09-migrazione-wordpress-hugo/index.it.md +++ b/content/posts/2024/2024-09-09-migrazione-wordpress-hugo/index.it.md @@ -56,7 +56,7 @@ Queste sono state le principali ragioni per cui abbiamo scelto di migrare da Wor ## Vantaggi della migrazione a Hugo per il BGLUG -La migrazione a Hugo ha portato numerosi vantaggi per il nostro team e la comunità del BGLUG, tra cui: +La migrazione a Hugo ha portato numerosi vantaggi per noi, tra cui: - **Maggiore velocità**: Il nuovo sito è notevolmente più veloce rispetto alla versione basata su wordpress, con tempi di caricamento molto ridotti. - **Sicurezza migliorata**: Senza la necessità di gestire un backend complesso come PHP o database MySQL, la superficie d'attacco del sito è stata drasticamente ridotta. - **Manutenzione semplificata**: Hugo richiede meno manutenzione, eliminando la necessità di continui aggiornamenti di plugin e temi. Possiamo essere relativamente sicuri che il sito web funzionerà perfettamente anche tra vent'anni