What is this about?#

I decided to switch from WordPress to Hugo. I always wanted to go back to a more static web page. For many reasons. The biggest one is that I don’t want to constantly update the software on my blog. I don’t want to be easily exposed to security bugs. Now that I switched I thought I should probably document somewhere, what I did and what kind of customizations I did for myself. 

If you haven’t noticed, I decided to use the terminal theme from panr. You can find it on the Hugo themes page or go directly to it right here. I wanted a rather minimalistic theme. I also love working on the CLI, so terminal was the obvious choice. 

One thing I have to get used to, is to write in markup. Then again, many other tools use markups and that makes this rather flexible. This is a good cheat sheet for markup.

My config file#

Setting baseurl = "" together with relativeURLs = true makes all the links relative. Makes it so much easier to move the whole page around. I was never a fan of absolute links. I hope I won’t forget to update this section every time I change the config.

My toml file
baseurl = ""
languageCode = "en-us"
theme = "terminal"
paginate = 5
tags = ['rambling', 'pictures', 'cooking', 'steam deck', 'programming', 'linux', 'gaming']
relativeURLs = true

[params]
  contentTypeName = "posts"
  themeColor = "green"
  showMenuItems = 4
  fullWidthTheme = true
  centerTheme = false

[languages]
  [languages.en]
    title = "Silicoid.de"
    subtitle = "My little corner of the world"
    keywords = ""
    copyright = ""
    menuMore = "Show more"
    readMore = "Read more"
    readOtherPosts = "Read other posts"

    [languages.en.params.logo]
      logoText = "Silicoid"
      logoHomeLink = "/"

    [languages.en.menu]
      [[languages.en.menu.main]]
        identifier = "start"
        name = "Start"
        url = "/"
        weight = "1"
      [[languages.en.menu.main]]
        identifier = "myconfig"
        name = "My config"
        url = "/myconfig"
        weight = "8"
      [[languages.en.menu.main]]
        identifier = "tags"
        name = "Tags"
        url = "/tags"
        weight = "9"
      [[languages.en.menu.main]]
        identifier = "about"
        name = "About"
        url = "/about"
        weight = "10"

Disable caching#

I did notice that my browser showed me an old page from my web server. Googled around and found this solution. Create a file layouts/partials/extended_head.html with the following contents. I don’t expect my page to get a lot of traffic, so turning caching of should be ok … I think.

Disable caching for all pages
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

A bit of scripting#

As I said, I like the terminal. I like writing my own scripts.

Generate web page script#

I use this script to generate and upload my web page. I remove all the exif data from images. I don’t want an information like location, to accidentally leak.

gen.sh
#!/bin/bash

cd ~/hugo/silicoid/ || exit 1
find . -name "*.jpg" -print0 | xargs -0 exiftool -all= -delete_original > /dev/null 2>&1
find . -name "*.jpg_original" -print0 | xargs -0 rm > /dev/null 2>&1
hugo --debug
rsync -avzd public/ silicoid.de:~/www/static
git add .
git commit