SandorHQ — The reincarnation
In 2015 after having played a bit with the Go language (and as many others I was also amazed to see that a mere “Hello, world!” code produces over a 2.5 megabytes executable file, although there is a perfectly reasonable explanation for this), and found out if Koa.js is sufficiently better for my purposes than Express, I have realized that for most of the websites no “domestic” server side technology is required. Even if the pages have dynamic parts, these are commonly implementing some kind of a commenting feature, social media interaction or service components like a Google map or a YouTube video, and all of these can be done using purely client-side JavaScript.
Moreover, since in some browsers disabling JavaScript is no longer a trivial matter, and since humankind has already invented the terms progressive enhancement and graceful degradation (they are all the same, only going to the opposite direction to keep the core functionality of the page accessible), I don’t see why it could not be a technical requirement for visitors to have JavaScript enabled in order to enjoy 100% of the page’s features. Of course it is good manners to present a noscript
message should the guest would miss anything important.
Back to the stone age!
Static websites are advantageous from technical and security aspects, because they can be deployed to a broomstick (just upload and have the files served by a basic Apache or Nginx), and even if some black hat thug breaks into the server of your webhost, the damage they do can easily be corrected, as there was no new data being generated on that particular server, so all you need to do is delete everything and re-upload your original content.
Jekyll and Hugo are static web generators implemented in Ruby and Go, respectively. The first is a well known and thoroughly documented application, while the latter might be of interest for those who are into experimenting with Google’s toys. A further benefit of Jekyll is that if one does not need Ruby plugins for their website, it is quite likely they can have hosting for completely free on GitHub, thanks to GitHub Pages. If online content editing on GitHub (!) is not needed, just build your static pages with Jekyll (or however you like) on your computer, and after a git push
all the deployment is done. GitHub Pages support custom domains (it couldn’t be any easier), so I see some chance for a declining demand for Wordpress and co.
What does Jekyll hyde?
Jekyll is a surprisingly flexible and efficient system out of the box, and even though I could implement everything – including multiple language support – without plugins, during development I have made a couple of interesting discoveries.
While I was creating new content, the sorting by publication dates of articles have suddenly refused to work. Jekyll only gave an entirely incomprehensible error message at build: Liquid Exception: Liquid error: comparison of Jekyll::Page with Jekyll::Page failed
. After some experimenting it turned out that the format of dates is extremely important so leading zeroes have to be there, otherwise Jekyll would have to compare a string with a Date object, but for some reason it was afraid to tell me this.
Kramdown, the markup language used at body copy, tries to generate an id attribute for headings using the text. Unfortunately all the non-English letters are simply omitted, and since I did not want to use a custom plugin which supports Unicode, I have decided to simply disable this feature – auto_ids
– in _config.yml.
The Liquid templating language, much like JSP, leaves white space around tags that implement server side logic intact, so the generated source code often has a lot of unnecessary gaps and empty lines. To avoid this I have found Jekyll-compress to be a surprisingly good solution, which uses only Liquid tags to eliminate all the unwanted spaces in HTML.
Although the Sass CSS preprocessor comes with Jekyll, minification and autoprefixing is still done with Node.js.
Hugo?
Although Jekyll is now capable of only building pages which have actually been modified (incremental build), and its speed is pretty acceptable, in the near future I would like to try its competition, Hugo, which I have mentioned already.