talkgroup

Building a Hugo site, a log

I’m building a new Hugo site to list things and my thoughts on them. As one does. I had been wanting to take the time to document how I do stuff with Hugo and here we are. :slight_smile:

Okay, so what is the first step? Well, I already use Hugo, I have hugo, git, and golang installed; golang to make use of go modules.

I think I’ll make a new hugo project. That isn’t what I normally do! I usually make a new repo with a readme on allthe.codes. But I thought, “hey, let’s see how this could work.”

Okay, let’s take a quick read of Basic Usage | Hugo

Ah, so I recall why I start with a repo first: I don’t use the config.toml, so aside from the archetypes/default.md there are no files to commit! So I start with a README.md (.md so it renders on repo websites) and COPYING (with the CC0) text in it.

Hence: prudence/web-build: Repository for building the website at https://prudence.io. - web-build - allthe.codes

I created a new org on atc to hold all the repos for the site. I like to keep a web-build repo to hold configuration, and then load other sections in as modules. It might make more sense in 10 years.

Currently my working tree looks like:

.
├── archetypes
│   └── default.md
├── content
├── COPYING
├── data
├── layouts
├── README.md
├── static
└── themes

I haven’t committed the archetype yet, as I don’t know what it will look like with content.

The next step is get a configuration file in place. So a quick jaunt to Configure Hugo | Hugo

There are so many configuration options! But I want to get to a web page being rendered, so my plan is to set the baseURL, title, and load tule as a module for the theme.

Looks like:

baseURL: "https://prudence.io/"
title: "prudence: insights; opinions"

module:
  imports:
    - path: "allthe.codes/tule/tule"
      disabled: false

That lives at config/_default/config.yaml.

One more step is to initialize the hugo module. In this case that meant:

hugo mod init allthe.codes/prudence/web-build

Which produces so go.* files that I don’t really pay attention to because I’m using Hugo rather than go for module handling. It might be useful in some other case, I haven’t come upon it yet. :slight_smile:

Oh yeah, a page!

Okay, so we’ve got a page going. Sweet! Let’s add a section for video games, since a lot of the #quest-board is just games (what knob set that up?!).

I like to create flat content repos, meaning no sub-directories unless it makes sense. We have a couple of games to add, so I imagine the repo will looks something like:

README.md
COPYING
super-mario-odessey.md
ftl-advanced-edition.md

Then I’ll mount that repo as a Hugo module and set a mount point at somewhere, probably /content/video-games/:

    - path: "allthe.codes/prudence/video-games"
      disabled: false
      mounts:
      - source: "."
        target: "content/video-games"

That means I ought to do something about those non-content files, using ignoreFiles in the config, so Hugo will, um, ignore them:

ignoreFiles:
- README.md
- COPYING

Okay… that seems about right, let me put it together and see what happens!

Hey, that worked out! I added a couple of video games (with only titles, to make sure it was working) and it does! So I went to fire a first instance by building the site. That’s when I remembered the other things to configure!

Currently I have two pieces of content, but here is my output to public:

.
├── categories
│   ├── index.html
│   └── index.xml
├── css
│   └── style.css
├── index.html
├── index.xml
├── sitemap.xml
├── tags
│   ├── index.html
│   └── index.xml
└── video-games
    ├── ftl-advanced-edition
    │   └── index.html
    ├── index.html
    ├── index.xml
    └── super-mario-odyssey
        └── index.html

I was expecting a home page and two video games!

  • index.xml are RSS feeds
  • sitemap.xml is a sitemap
  • categories and tags are taxonomies

I’m not currently using any of those, so I’m gonna turn them off. I know, I might want some of those, but I like configuring each part to know what’s happening.

disableKinds ([ ])

Enable disabling of all pages of the specified Kinds . Allowed values in this list: "page" , "home" , "section" , "taxonomy" , "taxonomyTerm" , "RSS" , "sitemap" , "robotsTXT" , "404" .

The array is empty by default, so let’s add something stuff! I’ll need “page” (for video games), “home” (for home page), and I’ll keep “section”, because I don’t know what that does. :slight_smile:

disableHugoGeneratorInject: true
disableKinds:
- taxonomy
- taxonomyTerm
- RSS
- sitemap
- robotsTXT
- 404

Notice that disableHugoGeneratorInject: true I snuck in? From the docs:

disableHugoGeneratorInject (false)
Hugo will, by default, inject a generator meta tag in the HTML head on the home page only. You can turn it off, but we would really appreciate if you don’t, as this is a good way to watch Hugo’s popularity on the rise.

Popularity as a metric is largely useless to me, I opt-out.

Run hugo again and:

.
├── css
│   └── style.css
├── index.html
└── video-games
    ├── ftl-advanced-edition
    │   └── index.html
    ├── index.html
    └── super-mario-odyssey
        └── index.html

Much better!

Okay, I think the next thing to do is… set up a web server somewhere? :thinking:

I had this domain, but when I was changing the DNS records for it I noticed it was expiring later this year and I’m all about that!

So… maybe a sub-domain… somewhere? What would make a good sub-domain for .interi.org?

Slept on it: I’m not going to track things in a database of things not to be tracked. I’m going to promote that which I do think is good. We’ll go from there.

talkgroup serves the purpose of what I was doing, anyhow, with the added bonus of it’s already up and has built-in commentary mechanisms. :slight_smile:

I’ll build another Hugo site soon, I’m sure!