Notes and Documentation

Migrating from Jekyll to Hugo


Jekyll

I’ve been using Jekyll to generate this site but it’s become increasingly frustrating to use mostly because of its dependency on Ruby/bundle etc. I keep messing up my dev environment by accidentally installing either a wrong version from a different source e.g Homebrew vs Ubuntu repository or by installing bundles in the wrong location like system level instead of user level.

Hugo

Hugo seemed to promise a simpler and more streamlined process of building and deploying which is why I wanted to test it out. Setting up the build environment was super easy since I only had to install a single binary.

Read more ⟶

Integrate Google Analytics with NGINX


Google Analytics

Google Analytics let you gather info about the traffic to your site. Once you create an account, you get assigned a tag. There are instructions on the GA site on how to enable analytics but it typically typically involves adding some HTML/Javascript code to the main page of your site.

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XXXXX');
</script>

Once you insert this code to the main page of your site, you should start seeing data on Google Analytics. For testing, you might need to disable any ad blockers as those might block the GA scripts.

Read more ⟶