Skip to main content

Recent Posts (Page %!s(int=17))

Photo by Yancy Min via Unsplash

Learning to git with git

I like to learn things by doing them. Recently I found a couple of interesting game formats that teach certain aspects of full stack developer’s life by playing a game. Let’s play? Oh My Git! is a game to learn Git, by using Git.

Photo by Mick Haupt via Unsplash

Print ordinal date suffixes (1st/2nd/3rd/4th) in GoHugo

Golangs $date.Format is unable to add ordinal suffixes to dates (like 1st, 2nd, 3rd, 4th). Let’s not judge Golang for that. The following is how I remedy this issue: layouts/partials/func/formatOrdinalDate.html go-html-template 1{{- $format := .format -}} 2{{- $date := .date -}} 3{{- $shortened := "th" -}} 4{{- if in (slice 1 21 31) $date.

Photo by Christopher Gower via Unsplash

CSP vs. syntax highlighting in GoHugo

If you are using the code styling functionality of GoHugo then you might have stumbled over a common issue when you are using Content Security Policies (CSP) and inline styles. Using CSPs is the proper way these days to secure your site code but it is considered (in the realm of CSPs) bad style to have your style sheets or JavaScript inlined into your page.

Photo by Gerry Roarty via Unsplash

Giscus Module for GoHugo

Giscus is a new star on the comment systems for static website generators orbit. It is inspired by the wonderful utterances and uses Github Discussions to save comments. It’s open source, easily configurable, themeable, translatable, and you can host it on your own server (it’s JavaScript based) if you like.