Hugo Custom Header - GNU Terry Pratchett


So, I recently migrated this site from Wordpress to Hugo. (Also I moved it from AWS to Netlify and I suggest you check out Netlify too if you have not done so already.)

But, I wanted to keep using the GNU Terry Pratchett headers and plugin, since Sir Terry remains my favourite writer and his books have given me too many new feelings, thoughts and ideas.

However, I could not find a mention on the plugin page on how to deploy the custom headers to Hugo, so I did it myself and I am going to leave it here in case someone else wants to use it, or generally add custom headers.

Netlify actually has a page to show how to add custom headers : https://www.netlify.com/docs/headers-and-basic-auth/

Using that, I created a file _headers in the static/ directory. The content of the file is:

/*
  X-Clacks-Overhead: "GNU Terry Pratchett"

This means that the custom header X-Clacks-Overhead: "GNU Terry Pratchett" will be applied for /* == all pages of the website.

Easy.

Now, head over to your browser’s plugin store and install the “Gnu Terry Pratchett” plugin, thank you very much.

“A man is not dead while his name is still spoken.” - Going Postal

PS: Also start reading the Discworld novels A-S-A-P!