Index for Hugo

Ctrl+F’able

There are many ways to organize your content in Hugo, including custom taxonomies. But I wanted something simpler: a page that lists all the “things” I have written about, with links to the corresponding posts. Here is how I figured it out.

Maybe not the best or most elegant way, but it works and since Hugo is a static site generator, no one will ever know! :)

“Index” is a bit confusing in the web world, but I mean it as “an alphabetical listing of items and their location”.

Content

So on the content side, we need to add this to front mater of each post:

items:
- Name of a thing
- Name of another thing
- Etc.

If there are some pesky characters like colon, the name should be enclosed in quotes: - "Thing: Not the other thing!"

Dictionary

Then we need a list.html in layouts/map/ folder. map can be whatever we want. I won’t cover how to deal with layouts. Here is the main thing, I will go through the details after that:

{{ $mapItems := dict }}

{{ range .Site.RegularPages }}
    {{ $mapDate := .Date | time.Format "060102150405" }}
    {{ $mapLink := .Permalink }}
    {{ $mapTitle := .Title }}
    {{ with .Params.items }}
        {{ range . }}
            {{ $mapItem := . }}
            {{ $mapUnique := printf "%s%s" $mapItem $mapDate }}
            {{ $mapUnique := replaceRE "^The |^An |^A " "" $mapUnique }}
            {{ $mapItems = merge $mapItems (
                dict $mapUnique (
                    slice $mapLink $mapItem $mapTitle
                )
            ) }}
        {{ end }}
    {{ end }}
{{ end }}

{{ $mapItems := dict }} creates a dictionary named $mapItems. Dictionary is a list of things where you have a key with attached value (one or many things).

I use $mapSomething for names. Can be anything.

With {{ range .Site.RegularPages }} we want to look through all the pages we have. It’s a loop that goes through them. Maybe that’s too much, there are ways to narrow it down. But if a page doesn’t have items: in its front matter, it won’t show up anyway.

Then we create three variables $mapDate, $mapLink, and $mapTitle that we are going to work with. With $mapLink and $mapTitle we are just assigning them to be (:=) link and title of our pages.

With $mapDate, we also pipe it (|) into time.Format to look like a string of numbers, with two for each year, month, day, hours, minutes, and seconds. We will use it to make our keys look unique, so if we have two posts that share the same item, they will not override each other.

{{ with .Params.items }} limits our pages to only those that have items: in the front matter.

Then we create another loop {{ range . }}. . (dot) represents the thing we just worked with from the previous command. So, the items:.

{{ $mapItem := . }} creates another variable. These are the items.

Then, for simplicity and readability, we create our unique key with two commands. First, we join the name of the item with the date of the post:

{{ $mapUnique := printf \"%s%s\" $mapItem $mapDate }}

Second, we remove articles (“A”, “An”, “The”) if the names of the items begins with them. This is obviously unnecessary, but why not!

{{ $mapUnique := replaceRE \"^The |^An |^A \" \"\" $mapUnique }}

Finally, we merge our dictionary (which is empty at the beginning) with the new entries we’ve created with our variables:

{{ $mapItems = merge $mapItems (
    dict $mapUnique (
        slice $mapLink $mapItem $mapTitle
    )
) }}

A bit of translation: $mapItems will now be equal to previous $mapItems plus new ( dict ), where the first thing $mapUnique is a key and a second thing ( slice ) is a value. The fact that it is a slice just means that there are multiple things in it and we can get them out individually.

To summarize, what we do is two loops. The first one goes through our posts and gets their date, link and title. Within it, so for each post, the second loop goes through our items: and adds them to our dictionary of things, with unique key and some stuff value that we will use to render our list.

List

Speaking of which, this is how we will render it:

{{ range $key, $value := $mapItems }}
    <li><a
        title="From {{ index $value 2 }}"
        href="{{ index $value 0 }}">
        {{ index $value 1 }}
    </a></li>
{{ end }}

We again use a loop, this time for the dictionary we created. It’s going to sort by key, that’s why we removed those articles so the list can be sorted in a nicer way.

In this loop, we use index to get the specific $value. They start from 0 and go as we set them with slice, post link, item, post title. Title is also unnecessary, but it will show up on hover and will be helpful if there are multiple items.

Conclusion

On my Log page, I decided to split all items into multiple categories. I did it very simply, but in a way that is easy for me to work with. Instead of having just items: in front matter, I have three different things: iGames:, iCinema: and iMisc:. Then in the list.html, I repeated the second loop three times, for each of these three things ({{ with .Params.iGames }}, etc.), and each of them adds items to the corresponding dictionary ({{ $mapItemsGames := dict }}, etc.). Then I render every dictionary as its own list.

I am more than sure that there are other ways to accomplish the same thing. There are always different ways to manipulate data. Dictionary just made the most sense to me, with a key that can be used to sort things nicely and then pull things up from value to display in a way I want.

Summary for July 2024

Hekki Alpha

Poorly lit, fancy to the point of garish, train car. Rebecca, a combat medic and one of the game’s protagonists, in a wide stance, her back to the closed door, a handgun pointed firmly at approaching zombies.”

It’s easy to see why the Resident Evil formula has survived to this day (hello, Signalis). It works! Even if the game, like Resident Evil 0, isn’t particularly inspiring and mostly repeats things we’ve already done with just a handful of innovations, it’s still enjoyable.

Anopek is a small metroidvania shooter. Nothing special, just nice.

Close up of a character with a dark window and some barely visible structures behind her. She is wearing a dark sea-green helmet, a cross between a sci-fi combat and a motocross one. We see her face, nose up, green eyes with bold black mascara, and blond strands of hair sticking out of the helmet. She looks sideways, away from the camera. The text box reads “Fixer” (her name) and “Watcher, we’ve been lied to.”

1000xRESIST is inspired by recent history, often directly: expect a global pandemic, immigrant life, high school shenanigans, and other things I won’t spoil. And it’s very cool to see underrepresented people both on and behind the screen, so to speak. But ultimately it is a sci-fi story, and a good one. Maybe slightly garish visuals. A bit. :)

The screen is significantly darkened. UI, the bottom half of a character is visible, but it’s hard to make out details. Large text across the screen says “The demon has been destroyed” in capital letters.

It’s hard to talk about Demon’s Souls, or any soulslike game for that matter, without, you know, talking about it. I won’t go into too much detail, but let’s do it.

I think the discussion about difficulty in games should instead be about accessibility. And in this case I mean accessibility in the broadest sense. I believe that games can and should be accessible to many more people than they are now. And the fact that we often talk about “easy mode” instead is very annoying.

It’s especially annoying because these games, at least the FromSoftware games that I’ve played – played Dark Souls 1; finished 2 and 3, and now finished Demon’s Souls – actually give you a lot of tools to lower or raise the difficulty (if you can play them at all, that is), and they do it well.

And of course it is even more annoying that we have to have this discussion instead of having one about the games themselves. Because they are pretty good, you know! Even if they just threw out the whole combat system that gives way to this annoying and misdirected discussion, there would still be a lot to like. The world, the exploration, the story, the atmosphere, the feeling of progress. Even muddy and dark in the way games were at the time, but still beautiful visuals. Good, good I tell ya!


Wendell & Wild is funny, macabre, and progressive. Not perfect (the deadnaming bit comes to mind), but still pretty enjoyable.

Pastel colored dome out of hexagons, with some huge white stick-like structures behind it. Mostly gray robot shaped like three spheres, one for a head, two for shoulders, rather small body, spindly legs, kneeling in the dirt, holding a flower in a tube-like arm.”

There is almost a whole genre of speculative evolution, of which After Man is probably the most famous. Scavengers Reign took that – mushed a bit with art by Mœbius, – as the setting for a story about people stranded on an alien planet. People from Nostromo, not Enterprise. And it’s also, like Alien, a kind of horror. I was a little disappointed that the story was not bad, but, for lack of a better word, pretty classic for such an innovative setting. But it’s very beautiful to look at, in that unsettling kind of way.

Two women, the main protagonist Alpha in pants and a short coat, with a ponytail, and the older Doctor with shoulder-length hair, wearing a overcoat, look down on an almost completely flooded city. It’s squeezed between mountains on the right and the sea on the left. At night, you can see it by the streetlights and bright windows of buildings shining through the water.
[Two-page spread from chapter 22 of the book]

There are two ways to look at  Yokohama Kaidashi Kikō (I mentioned it before). On the one hand, it’s a gentle look at the death of the world. Post-apocalyptic doesn’t have to be violent, cruel, or even unpleasant. We will all die, our cities, our world. So why can’t it be peaceful and beautiful?

You can get the most out of it by watching just 4 short episodes of an animation. The books expand on this and introduce more characters and their stories.

On the other hand, somehow optimistically, it can be seen as a transformation that our world can take – be forced to take – and still be fine. People, even if some of them are robots, will still be doing people things. There would be communities, celebrations, daily work. And maybe it’s better that way.

Summary for June 2024

Bigger on the inside

There seems to be no consensus on how well mental health is portrayed in Hellblade games, and since I’m not an expert, I won’t say more.

Senua, dressed in leather pants, skirt, and corset, with a sword at her belt, watches the huge burning tree with corpses in tortured poses hanging from its branches.

What I can say is that it leans a little too much towards punishing the protagonist for my taste. It makes the comebacks more powerful, but I don’t know if it justifies the whole thing. To put it another way, I was curious about the first game when it was released, and felt compelled to follow the story in the second, but wouldn’t be upset if I never played both.

For me to consider something problematic, both the good and the bad should be on a comparable level. It’s not perfect, but Doctor Who seems to have been pushing diversity for a while now. I even started watching it after they announced that there would be a female Doctor.

The Doctor, a black man in a long leather coat and blue trousers, and the Doctor's companion, Ruby Sunday, a white blonde woman in a short coat with white fur trim and a dark red tartan skirt, leaning against the TARDIS.

At this point I have watched everything with the Ninth, Tenth, Thirteenth, Fourteenth and now Fifteenth Doctors. Yes, I skipped the Moffat era.

On the other hand, the BBC seems to be pretty bad in many areas. Is it worth it? Well, I don’t give money to BBC, so sure.

The show has a somewhat weird and unique tone, where it tries to be for as much of an audience as it can, so sometimes it can be too silly or simplistic. But the premise means that almost every episode would lead main characters on a pretty unique adventure, and if you like those characters, then at least it would be fun, if not provocative, gut-wrenching or awe-inspiring, which occasionally happens too.

Summary for May 2024

Puzzles, secrets and discoveries

Sunlit colorful garden. A path leads to a white, almost more glass than anything, greenhouse.

Botany Manor is brilliant. There is nothing more frustrating than illogical puzzles. It is subjective, but I never got stuck on one in this game. The overall pleasantness of the world with a touch of, shall I say, melancholy also helps.

Night. Barley illuminated, almost a silhouette, girl standing in front of the gates of a school.

Gylt is a more light-hearted Silent Hill, I guess. Not particularly scary, but spooky atmosphere, with lots of world to explore, secrets to discover and enemies to fight.

Indika left me cold. Not a bad game, not at all, but if the story does nothing for you, like it did for me, there is nothing else there.

Embroidery of a very happy penguin on a table. Around it are threads, buttons, pins, scissors and other similar craft tools.

Stitch is an interesting variation of nonogram-like games. You have numbers that tell you the size of rectangles that should fill the whole area. The overall picture kind of helps because you can guess which colors go where, but it can fail in places if you’re colorblind. There are a lot of penguins!

There’s not much more I can say about Star Trek: Discovery now that it’s finished its final season. Also, I tend to judge the thing as a whole, not individual elements. In the end, I’m glad I watched it, but I wouldn’t give it a medal, so to speak.

Summary for April 2024

Nintendo. Nintendo never changes.

Lucy, one of the protagonists, in an iconic Fallout look: blue jumpsuit pulled down to look like pants, white tank top, a leather shoulder pad, Pip-Boy on her wrist, and a handgun in her hand. She is standing in front of a ruined Super-Duper Mart. The subtitle reads “Golder Rule, motherfucker.”
[Shot from the episode “The Ghouls”.]

Fallout is a comedy. A dark, violent, crude, bloody comedy. That doesn’t mean it’s funny, the structure is comedy. Ridiculous and awful things happen to ridiculous and awful people. But yeah, sometimes it is funny. And very good!

Princess Peach in a green Sherlock Holmes-esque costume looking through a magnifying glass.

Princess Peach Showtime! has an inherent problem: rarity. Mario seems to appear in a dozen games a year, but Peach may appear as a playable character in two, if that. So no matter what happens, the game will be at a higher level of scrutiny. I’m not saying that as an excuse, Nintendo doesn’t deserve it. They should do better!

But if you ignore that for a second, I think the game is pretty good. Not great, but good. Would be a great start to a series! *stares at Nintendo*

Also, it seems that the premise of the game – Peach playing many roles – is the answer to the rarity problem. They want to bridge the gap faster by having 10 games in one. That is probably not the logic the developers had, but it is funny to think that way.