Introduction
How can websites be set-up?
Generally speaking there are two main ways of how internet web sites can be set up:
- Dynamic
- Static
Dynamic Sites
Dynamic sites use server-side processing and the actual content of the pages is typically stored within database tables.
When a user requests a page the server side process (like PHP) fetches the content from the database (like MySQL), loads the available templates and renders the HTML Webpage “on the fly”. The complete page is typcially never stored in its entirety - except maybe within some caching mechanism that helps to speed up everything.
Static sites
Static sites on the other hand are stored as files, ready to load on the webserver. There is nothing complex, just a webserver serving individual files or HTML pages.
The “magic” takes place a the time when these HTML files are created. After all, you certainly don’t want to manually create a big amount of HTML files.
We also have a separation between content and layout on static sites. However this separation is only existing on the (local) “Development Machine”. Typically you would have two separate directories in a file system. One containing a bunch of layout defining files. And the other one containing the (almost) plain content files.
Whenever you want to change something on your website you just update the content file. Then you call a piece of software the Static Site Generator - or as this is a lengthy phrase sometimes you will find the abbreviation SSG (SSGs).
Typically SSGs contain a template engine that supports strict separation of layout and content.
This software will then take (all of) your content files and in combination with the layout files render the full list of ready to server HTML files in a third directory. All you finally have to do is upload these files to your webserver.
And don’t worry if this sounds like a lot of manual steps at first sight. All of this can be automated in various degrees. And even the Development Machine does not necessarily have to be your local computer. It could also run in the cloud (aka someone else’s computer 😄 )
What are the benefits?
Some advantages of static sites:
- Blazingly fast: Can cope very easily with sudden peaks in demand
- Simple to maintain
- Focus on content
- Can be left alone for long time “risk free”: Once the site is set-up, no further updates of technology necessary, as long as you are fine with the way the site currently is. Compared to CMS’s like Wordpress where you constantly need to install updates and security fixes, just to keep your site running and still be safe from being hacked.
- Easy workflow automation is possible: Just write a new article and commit it to your version control system. Then get site rendered and uploaded and you are done.
Some even call it “The New Trend”
Let’s get into the details
There are various Static Website Generators available.
If you would like to get an idea what broad spectrum of static site generators are available just visit https://www.staticgen.com/. But be warned. The sheer amount of available tools will most certainly overwhelm even somewhat experienced people. Let alone someone who has not any sort of experience in that area.
We will focus on the Static Site Generator Hugo here.
So, just to bring you back into some guidance. The most popular ones are probably Hugo and Jekyll. While Jekyll being the older project (first release in 2008) Hugo (first release in 2013) is the one we are going to go into detail here. One of the reasons for that is because Hugo is renowned as (being)
“The world’s fastest framework for building websites”.
What is definitely also a big plus for Hugo is the fact that it is very easy to install and set-up. It‘s just one executable without any dependencies on any tool-chain.
Just to give you a first impression here are some of the highlights of Hugo:
- Open Source and Free: No vendor lock in whatsoever, you stay in control of your data and web-pages, Code available on GitHub
- Fast: renowned as"The world’s fastest framework for building websites"
- Single Binary, Cross Platform, No dependencies: Most other Static Site Generators expect you to have a full tool-chain set-up for their language. Hugo is written in Go and distributed as an executable for Unix, Linux, Windows and Mac. Just download and run.
- Clean workflow: Create your new site, run the Hugo server, edit. Lather, rinse, repeat. Hugo stays out of the way.
- Draft mode: Allows you to see changes in real time
- Easy enhancements: add new content types, data files, and taxonomies
What problems could you encounter?
While certainly Hugo has its advantages it is definitely not a type of software you install and then you are ready to go. Quite contrary installing the software will be by far the most simple thing you will come across. The real work and challenges will come after that.
And that is where StaticNicheSites will help you.