Hugo is a tool for creating static websites. How is this different from a dynamic website? you may be wondering. While a static website is delivered to clients in the same way that is stored, dynamic websites build pages using an application server. As a consequence, static and dynamic web pages have contrasting properties:
|Required Expertise for Maintenance||High||Low|
|Potential for User Interaction||Low||High|
Let’s take a look at these aspects in more detail.
Static websites can typically be loaded much faster. Why? Displaying a static page essentially only requires loading the associated HTML file as well as any additional resources (images etc). For a dynamic site, the same data have to be loaded but the dynamic content has to be loaded additionally. Since this type of content typically requires interacting with a database, it takes some time until the data have been loaded and the final page is ready.
Maintaining a static site is slightly harder than maintaining a dynamic site. This is because dynamic websites are usually based on content management systems (CMSs) such as WordPress. CMSs are very easy to use because content can be created in what-you-see-is-what-you-get editors. For static websites, on the other hand, such editors are not available and it is necessary to work with data in a more raw format such as Markdown, which merely specifies how the content is supposed to look. So, if you are not a person that shies away from some technicalities, static web pages are fine. But if you don’t like the idea of working in some form of code editor, then a static site is not for you.
With regard to security, static sites are definitely the safer alternative. Since dynamic web sites rely on several applications that run in unison (e.g. CMS, database, additional scripts) it is more likely that one of them is vulnerable to attacks. For example, there is a long list of security vulnerabilities for Wordpress, so it is key to continually update the software to stay safe. With static sites, on the other hand, there is no software that is running in the background, so there are no vulnerabilities and it is not necessary to continually update.
Potential for User Interaction
The low potential for user interaction is the biggest downside to static websites. For example, a dynamic website may display the five most popular posts, show a poll where users can participate, or may ask for users to upload their own content. These dynamic elements can hardly be integrated into static websites. For example, for something simple as a commenting systems, many static web sites rely on external services such as Disqus. However, there are also alternatives such as Staticman.
Posts about Hugo
Since this blog has been created with Hugo, the following posts deal with the framework.
Taxonomies in Hugo are a great way to structure information provided by a blog. For search engine optimization (SEO) purposes, however, the existence of duplicate content on a site can be a problem. If you think this is the case for your site, then you can use the noindex meta tag for all of the taxonomy sites that do not provide unique content. This post shows you how to get it done.
Static blogs are a great alternative to dynamic blogs that are based on content management systems such as WordPress. While both approaches have their up- and downsides, I chose the static approach for this blog because it’s the easiest way to bring R code to the web. In the following, I will show how you can create a static blog in only five steps.