Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Today I Learnt

A Hugo-built static site of Today-I-Learnt (TIL) posts, designed to make it as easy as possible to publish a new post.


This repo provides two Bash scripts for writing a TIL post and capturing screenshots to include in a post.


The TIL posts are built into a static HTML site using Hugo and are published via Github pages. The final site is available at:

Hugo theme

The theme for the site is a customised version of Etch.

Code structure

The repo is structured to keep the TIL content separate from Hugo - all Hugo-related content is in /hugosite.


Checkout the repo and create shell aliases for the two helper scripts:

# ~/.bashrc
source /path/to/repo/

Consider adding this sourceing to your Bash start-up script.

Note, the script requires pngcrush and imagemagick; both of which can be installed from Homebrew:

brew install pngcrush imagemagick


Create a new post with:

til $description

For example:

til that cows cant look up

which will create a markdown file, named by slugifying the description (i.e., pre-populated with Hugo front matter:

title: "TIL that cows can't look-up"
date: "2020-07-24"
tags: []

and open Vim in insert mode with the cursor in the appropriate place.

You then add the TIL text.

To add screenshots, CTRL+Z to background Vim and use the screenshot helper:

til_screenshot $description


til_screenshot Alfred preferences UI

which will trigger MacOS's screencapture utility to capture a selected portion of the screen. After selection, the resulting PNG image will be saved to static/images/ using a filename based on a slugified $description and the markdown to include in the post will be added to the system clipboard.

After saving and exiting Vim, the markdown file and any new images will be committed to the repo.