Why a Static Webiste?
As some people might have noticed this is a static website build on top hugo and you might be wondering why I choose to do it that way. Well a couple of reasons:
- I’ve always been a person who liked to keep presentation separate from content and thus wrote a lot of my longer papers in college in LaTeX (also long documents with lots of images and formulas are less likely to break) sure for something short (or something that needed to be shared with a group) I might have fired up word or libreoffice but on the whole a lot was written in LaTeX. So writing my stuff in markdown is no problem for me (especially with a proper text editor)
- This site is actually hosted on a fairly minimal VPS with the server located inside the EU and having to only take care to update caddy and not a full LAMP stack make my life a lot easier. (In my college days I used to manage a website for a student organization and keeping track of all the needed security updates was pain, especially for someone dealing with depression/autism(/ADHD?))
- I like the idea of a static site for my personal blog, no one else is going to update this so have no need for user management, an admin panel, or something like that.
- I can backup my site to github/gitlab and also use that to work on my site from my laptop, chromebook and desktop (also my phone if I really wanted to!)
- Less complexity should generally lead to better security
So that are my reasons below I go a bit more in depth on some of my opinions, do note this is more opinion than actual fact and you might come to a different conclusion even in similar circumstances!
Should you use a static website?
Depends on what your use case if you need multiple people to update your site, want a comment section, or an integrated shop, you might be better of with a dynamic site like wordpress or similar. On the other hand if you just want a simple blog, landing page, or gallery page that will only be managed by one or at most a couple of people a static site might be a better option.
But even in the later case I sometimes see people advise to go for a wordpress site sometimes worded in the following way This was comment on a youtube video which basically went over the differences, it probably attracted this comment because the video basically boiled down to
computers are so powerful these days so why bother with static generation for smaller sites?
(this is paraphrased)
It might be obvious that I disagree with that statement there are many more reasons to still prefer static over dynamic than just pure performance. Some of which I mentioned above already.
Anyway to go over it a bit more easier here is the above in pure text form:
I’ve used both wordpress and static site generators. My advice is go with wordpress. Why?
- A lot of themes and plugins
- There is answer to any question
- Admin panel
- You still need backend for emails
- Much faster to build and deploy
- Easy SEO and caching with the help of plugins
We will be going over this one by one starting at the top
A lot of themes and plugins
Both Hugo and Jekyll (two famous static site generators) have huge libraries of themes, and come with a bunch of plugins and ways to make new ones. If you use something else that is like using something different from wordpress or drupall in which case you have the same problem. In all cases you probably want to adjust the themes to your liking. Also the larger the community, the more themes will be created, and thus has not really anything to do with static vs dynamic.
There is an answer to any question
This is again just due to the large user base/community, both Hugo and Jekyll are also quite large so finding answers to problems is probably not that much harder. So not really due to things being static.
Admin panel
This is the first thing that actually requires a dynamic site, but do you really need it on a static site? A static site is just a bunch of files uploaded to a location, and maybe some (often only one time) setup of the webserver and if you use some kind of shared hosting often not even that. If you use a VPS you might want to have an admin panel for that but either your VPS provider will have that or you can install something like cockpit (which can be setup to be only be accessed via ssh so not possible to hack via the webserver).
A dynamic site does require some kind of admin panel if just for the management of users, and content but that does not make it better than a static site, on the contrary it might actually be another attack surface.
Still need a backend for emails
Do you? These days there are many ways to deal with emails, and due to the complexity of dealing with an email server it is generally recommended not to self host for smaller sites.
Faster build and deploy
Haven’t used wordpress/drupal/etc in ages so don’t know how fast it is to setup, but my current site (the one you are looking at) was build in a day and deployed in a couple of seconds. Most of the time was spend writing an article to see how it would look like, so probably could have done it in a couple of hours if I really wanted to.
Easy SEO and caching
Caching is hardly needed on a static site, and SEO is again template and generator depended, and has not a lot to do with dynamic vs static.
But what if I like WYSIWYG editing?
Not everyone likes to look at unformatted text I get that, luckily for you there are option to make editing markdown more WYSIWYG! For hugo just look at some of the recommended frontends and for jekyll there are some recommendations on the resource page
And with the right plugins plus git (or other source version control systems) sharing between multiple people becomes easy with everyone being able to add (or remove content). Sure this setup is probably not suited for a large group and does require some technical knowledge, an alternative might be to just put the files on a NAS.
Now even with the above this setup is not for everyone and especially if you need to deal with a large group of users not all of which are technical inclined a dynamic setup is probably easier to manage in the end.
Conclusion
I think static site have a place even if you just have a small blog, or landing page. A static site is also easy to deploy on all kinds of hosting ranging from the ‘home’ space some ISPs provide to actual hardware and anything in between without having to deal with backend servers, and only have to worry about keeping the webserver up to date (and probably your SSL certificate but that can be automated these days) and only that if you use a VPS or actual hardware since in many other cases your hosting provider can take care of that.
Of course I am biased so the above might not be for you, if that is the case please keep using what you enjoy I am not here to judge!