Hugo Tips

Page content

My most used search terms

  • Front Matter.

Tags and categories will not work unless you specify the following in config.toml

[taxonomies].
    tag = "tags"
    category = "categories"
```

## Generate and publish!
But there is an error in the generate...

```
% hugo
WARN 2022/05/10 01:48:18 Module "ananke" is not compatible with this Hugo version; run "hugo mod graph" for more information.
Start building sites ...
Total in 87 ms

Error: Error building site: render of "404" failed: execution of template failed: template: 404.html:1:24: executing "header" at <partial "page-header.html" . >: error calling partial: execution of template failed: template: partials/page-header.html:23:9: executing "partials/page-header.html" at <partial "site-navigation.html" . >: error calling partial: "layouts/partials/site-navigation.html:3:21": executing of template failed: template: partials/site-navigation.html:3:21: executing "partials/site-navigation.html" at <.Site.Home.RelPermalink>: error calling RelPermalink: runtime error: invalid memory address or nil pointer dereference

I got into a bit of trouble with this, but the cause was that the index.md directly under the content directory was in draft status (draft: true). I saw someone on the forum asking about a similar error, but I wasn’t sure, so I built a new one and checked the process in order. Hugo is nice and quick in this area.

Google Analytics Setup

Huh, is it a bit of a hassle to support Google Analytics? There is a useful parameter called “googleAnalytics” in config.toml, so I thought I could use it, but it seems that the latest gtag.js does not support it. (If you use the old type of analytics.js, you can use this one.)

META NAME=“ROBOTS” CONTENT=“NOINDEX, NOFOLLOW”

% HUGO_ENV="production" hugo

Generate by specifying production. This is the way to deal with it.

Reference
https://qiita.com/momotaro98/items/4de7934fd79cd6b34fce https://knowledge.sakura.ad.jp/22908/

https://qiita.com/kengrasshopper/items/89734881da7702a1a72d