Site update

by Anthony Greenberg, posted on Jan 6, 2021

When I first set up this here outfit more than five years ago, I needed to quickly set up a website to advertise myself. At the time, I heard about Squarespace from their ads on some podcasts I was listening to. It fit the bill perfectly: nice clean design templates, analytics displayed in a well-designed iOS app, e-mail service through Google, simple to add markdown content, no need for CSS coding. I have been with them ever since and have had zero complaints about the service itself. It has been rock stable, too.

However, one does give up a fair amount of control when letting someone else take care of all the details. Over time, I have developed particular needs that Squarespace cannot accommodate. For example, I use Doxygen to generate software documentation from comments in my C++ code. This software helpfully generates and HTML document that allows a user to easily navigate and search through the documentation. The document is not a self-contained HTML file, though, so it is impossible to add it to a Square space site (at least last time I contacted support about this). Similarly, I have been playing with plotly to generate plots in R and display them in a web page. Again, adding a widget like that directly on the site seems to be impossible. Furthermore, I would like to script the update process for such plots, as I generate new ones for the COVID page every day. I have come up with various kludges and workarounds involving my page, but it has been a low-level irritant for a while.

So the time has come to migrate the site. I only need to serve relatively simple content on this website, so it was natural to use a static site generator. There is a number of them around. GitHub pages use Jekyll and I had a little experience with it when I set up my page. However, I opted for HUGO because I heard it is fast. I did not compare it to any other generator on my machine, but I can say that it builds my site essentially instantaneously, making development very smooth. If there is anything that benchmarks faster, I doubt I would notice a difference in practice. HUGO boasts many themes written by users, so if you do not want to muck about with CSS, you do not have to. I did look at a few themes for inspiration and code, but ultimately opted to learn some web dev and write my own layout. I prefer the minimalist flat look and I am using the Nord color theme. I use it in all my terminal and desktop applications and find that it reduces eye fatigue, although I am sure that varies from person to person.

Since this is a static site (each visitor sees the same content), there is no need for cookies or trackers. That is a big selling point for me. I used Google analytics on Squarespace to count visitors, but it never sat well with me. I really do not like to track anyone, so the new solution is much better. I will use server logs to count visitors and see which pages are popular. I am still learning how to do it properly, but I will be deleting logs periodically and will never use the IP addresses to track visitors. I am definitely not going to share this information with anyone.

I am hosting the site on Amazon Web Services LightSail. There are other options (DigitalOcean looks good), but I have been using AWS for years and it seems like a bad idea to switch everything at once. I am running an nginx server on FreeBSD. If you have even a passing familiarity with FreeBSD (and you do if you use the command line on MacOS), DigitalOcean has very easy to follow instructions on how to set up nginx and get everything going. I prefer FreeBSD for servers over Linux because of superior stability. I also feel like Linux accounts for the bulk of server install base, so running something a bit off the beaten path enhances security, even if only slightly. I am using Let’s Encrypt to serve the content over HTTPS. While there is nothing particularly confidential a user would receive from this website, authentication is an important benefit of secure connections. A secure connection also prevents a man in the middle form injecting unwanted or malicious content.

This is the first iteration of the re-design. I will continue tweaking things. I would appreciate it if visitors let me know if they find that something is broken. You can e-mail me (from the contact page or yell at me on twitter.