Hugo is a static site generator. The goal is a series of folders (directories) and static files (.html, .css, .js, .json, .txt) that can be directly uploaded to my web hosts ‘public’ folder. I use Google Firebase to serve my static page, but any web host can handle static content. But why static?
Static is Cheap & Fast
Static pages are pre-built html, styling, and .js files. In general, having these files ready to go when someone clicks on a link to your site means faster load times. Since there’s no active database backend, hosting is as inexpensive as it gets. I don’t have to deal with SQL or MongoDB backends, vulnerabilities, updates, or scaling. It’s also cheaper and easier for me to scale static as all I’m doing is copying a few files across CDNs, not trying to run pages in advance with advanced caching strategies (see any speeding up Wordpress article). Bueno! Cheaper to host (free in my case). Faster load times. Very low likelihood of hacking (less they breach my host provider or CDN). What’s the drawback?
Static is NOT Easier
No Nginx/Apache Developer Environment
Hugo server -D. Boom. I see my draft site in milliseconds. Hundreds of pages, images processed, served to local host. And I didn’t need to spin up a Linux VM. Don’t get me wrong, I love Linux and don’t mind starting one with Apache, mounting my development folder, getting everything running properly, just so I have a fast editor – only to break half of it when I try to upload it in production…wait. I mind. Synchronicity of developer/deployment environments is one of the reasons I love static sites. There aren’t megabytes of PHP and an SQL database to migrate, so when I upload, chances are it’ll look exactly as I expect – baseURL aside (did have a freakout when the site didn’t show up and I realized all my links were to localhost; quick fix in config.toml)
Now I’m Bad at markdown
A workflow that works for me is key. I have been in and out of GitHub for a few years, but never really understood markdown’s odd combination of HTML and custom tagging. Luckily, markdown takes most semantic HTML. So, for posts like these, I have a nifty little image processing shortcode and write in my authoring editor of choice MS Word (DON’T HATE: text editor of choice is probably Atom, while I develop in VS Code and Spyder). I simply saveas->html and copy everything into an index.md. If only that was it…use more options, web options, and change encoding to UTF-8. Yay. I won’t get into saving themes in MS Word.
So far so good. I’m liking Hugo. What about you? What frameworks do you build in?