TDSTG.com - Posts

Eliminating Duplicates from a List in Hugo

Published: 2024-05-17
Updated: 2024-05-21

In processing JSON records for a Hugo site I needed to remove duplicate ID elements in a list. Here's how I did it.

Slugify a String of Text in Golang

Published: 2024-05-17
Updated: 2024-05-17

A function which takes an input string and converts it to a "slug", a string of text suitable for use in an url address

Convert to a Friendly Date Output in Golang

Published: 2024-05-12
Updated: 2024-05-17

A function which takes an input string of the format YYYY-MM-DD and converts it into a more readable "Mar 06, 2006" format

Use Certbot to Issue a Digital Certificate for Your Site

Published: 2024-01-29
Updated: 2024-05-16

Certbot from Let's Encrypt is the best thing going for installing and maintaining your site certificates. Use this simple one-line command to set it and forget it.

Sample Apache Virtual Host Configuration File - vhost.conf

Published: 2024-01-19
Updated: 2024-05-16

If your server's reverse-proxy is Apache, you'll need to set up VirtualHost blocks for each domain you're hosting. Here's a sample vhost.conf file you can use to get started.

One Command to Update PiHole

Published: 2024-05-12
Updated: 2024-05-16

How to update your PiHole device to the latest releases, all in a single command

How to solve loop variable captured by func literal in anonymous Go function

Published: 2024-05-14
Updated: 2024-05-16

In my process of learning how to code a Golang web crawler I ran into an unexpected warning: loop variable url captured by func literal

How to Show Most Recently Updated Posts in Hugo

Published: 2024-02-04
Updated: 2024-05-16

This site's home page features my most-recently updated 5 posts. This the template logic that makes it happen.

How to Show Most Recent Posts in Hugo

Published: 2024-02-04
Updated: 2024-05-16

This site's home page used to feature my most recent 5 posts. This post shows how the logic that made it work

How to Set Up a Custom 404 Page With Hugo

Published: 2024-04-28
Updated: 2024-05-16

Here's how I set up a custom 404/NotFound page for this site.

How to Customize a Page Type in Hugo

Published: 2024-02-08
Updated: 2024-05-16

I struggled with this a bit longer than I might should have. In the end it wasn't too difficult but it also wasn't so straightforward to be obvious. Here's how to set up a custom page layout for any type of page you might imagine in Hugo.

Add Google Tags to Your Hugo Static Web Site

Published: 2024-05-07
Updated: 2024-05-16

Adding Google's Tag Manager connect code to your static Hugo site won't take long. Here's how to do it in 3 simple steps.

Add Certbot to Ubuntu Server

Published: 2024-01-29
Updated: 2024-05-16

Certbot from Let's Encrypt is the defacto method for installing and maintaining TLS certificates. Before you can use it on your new Ubuntu server you have to install it. Use this easy one-liner to make it happen.

Add a Debounced Scroll-To-Top Button to Your Site

Published: 2024-05-06
Updated: 2024-05-16

With a few lines of code you can add an unobtrusive button to your site that, when clicked, takes visitors back up to the top of the page.

Get a Page's Folder Name in Hugo

Published: 2024-05-12
Updated: 2024-05-16

I needed the name of the folder in which a page was stored in order to make shortcode processing a little bit easier. Here's how I managed to do it.