Love.Law.Robots.

Love.Law.Robots. is moving!

You're browsing the original version of the Love.Law.Robots. Check out the new site. It's prettier and packs loads of new features!

A fresh new beginning for My Blog

Featured Image `

Regular visitors might notice that the design of this blog changed in October. Here’s a short explainer on why I did it.

Leaving WordPress#

For a very long while, I worked with WordPress. In around 2004 when I first tried it out, it was magical because it did many things – a WYSIWYG (what you see is what you get) interface and document management out of the box. Over the years, it grew bigger and more powerful. WordPress powers over 30% of websites on the internet, so it’s a reliable, mature and great product.

However, its ubiquity also made it an enticing target for hackers. As I have some knowledge of security, I knew my WordPress installation was vulnerable. True enough, my tiny and harmless website was probed by robots looking for vulnerabilities.

At least the WordFence plugin managed to stop all these attacks.

At least the WordFence plugin managed to stop all these attacks.

The real problem though is that running a server is a lot of work. I always have to install all available security updates and monitor for funny business. I also need to listen for any red flags concerning the plugins I use. Due to the nature of open-source software, I can’t fully control the security of my system.

Furthermore, I am not sure whether I appreciate the full power WordPress can bring. Reading through the analytics on the website, I get a sense that few readers comment on posts or use the fancy sharing buttons. It appears that I could live with far less. Say what you will, but I was Marie Kondo-ing my blog.

The last issue that bothered me was cost. I wanted the power of running my server but didn’t want to pay an exorbitant price for my project. Sometime this year, I did find a sweet spot and signed up for it. However, it would be nice to save on hosting and spend money on other things (like a new laptop!).

It’s time to go Serverless – Enter DigitalOcean App Platform and Hugo.#

I wanted to spend less time running a server and more time doing the things I enjoyed, such as writing this blog or developing applications. To focus on my applications, I wanted to make use of the wide availability of cloud resources today. In short, it’s called going serverless.

This part explains how this blog went serverless:

  1. The main objective is to serve static pages. As such, our pages are complete when they reach the browser, and they do not require calls to a server or much client-side processing. (For example, in WordPress, every visit is computed and served fresh for each visit unless it’s cached.)
  2. A static site generator produces static pages. For this task, I picked Hugo. I’ve had some interest in learning Go, so I’ve always been curious about Hugo. (Generating a Hugo website requires little to no Go knowledge though.)
  3. Pick a layout theme and edit it all you like. (I customised codex a lot for this set up.)

Now all I needed to do was to find a server. Coincidentally, I was able to try out a beta program for DigitalOcean’s App Platform. App Platform allows you to run applications using your GitHub repository (this can be a private repository).

DigitalOcean App Platform image

What’s great too is that for static sites like this blog, App Platform is free! There are fair use limitations which I will probably never bust running this website. With this, I get access to a straightforward continuous deployment process, a place to store the web pages and a content delivery network.

Since these are static web pages, there are no logins or passwords to mind. The only servers to be hacked are at DigitalOcean and its providers. I am sure they do a much better job at securing their systems than me.

You’re going to hear a lot about DigitalOcean on this blog. That’s because I have enjoyed using their services and I believe you will enjoy using them too. What’s more, you can use my referral code to get $100 worth of credits , which is enough to try lots of things that DO can do!

An improved workflow#

If I am the only author on the site, the workflow for Hugo is relatively straightforward. Write a markdown page, add it to the contents directory, commit to my blog repository and let DigitalOcean generate the website. It’s not as user friendly as WordPress. However, I do get access to Git which means I can reproduce my blog anywhere. It’s more “user friendly” in this regard than WordPress which needs to duplicate a SQL database and a content directory and then import manually.

Recently I managed to rope in my wife to help edit the site. She acts as an independent second eye to ensure the content doesn’t read like rubbish. However, she isn’t a techno-geek. I didn’t want to burden her with getting a GitHub account and figuring out how to “approve” a pull request or make amendments on a commit.

Another benefit of going serverless is that with some ingenuity, there’s always some workaround. The basic idea, if you want to avoid GitHub in the editorial process, is to leave GitHub out of the process. In this case, I used Google Docs and Airtable (a project management app) to take care of this:

  1. I would write a post in Google Docs.
  2. Add the post to the Airtable Kanban and change its status to “Pending Review.”
  3. Airtable would automatically send my wife an email with a sharing link to the article on Google Docs.
  4. Once she’s done, she can update the status to “Review Completed.”
  5. Airtable automatically sends me an email on the change in status.
  6. I would convert the document to markdown and do my tech Kung Fu to put it up on the blog.
What looks like a series of boards becomes a simple publishing platform.

What looks like a series of boards becomes a simple publishing platform.

Besides not forcing GitHub to become some publishing platform, going serverless does allow you to use familiar tools. Google docs have relatively similar features as Microsoft Word. It’s also available on mobile. It’s also a mature and free product that most people have. So my wife doesn’t have to learn or install many new things, and she can get started on editing quickly. Airtable is also fairly pretty, so hopefully, everyone enjoys being part of the project.

Another neat feature is the automation which makes life easier for all of us. Take note that my automation above (sending emails) is available on the Airtable app by default. Having robots work for you might sound futuristic, but it’s more of studying your processes and asking yourself how to automate it.

Conclusion#

I’m pretty pleased I have finally made the move to go serverless. It does help that many tools are now available, such as DigitalOcean’s App Platform and Airtable. Hopefully, the time I invested in making this move helps to give me more time to write content.

As with any transition, the site might be pretty buggy. If you find any broken links or resources, please be an angel and let me know! Thanks!

Cover photo by Tierra Mallorca on Unsplash