Rick Cogley's Tech Logr

Short Technical Laser Bursts %%

RC Logr 20190409 144438

Tuesday, 9 Apr, 2019

After upgrading to static site generator «Hugo 0.55.0», building with hugo server -D returns a couple of non-fatal warnings that should be corrected. 🐞

  1. The .Site.Pages includes section pages so you might need to change it to .Site.RegularPages. I was building an index.json for searching and relying on it to supply data to a script, but after the upgrade, the index included pages with no content. To fix, I just changed to the latter.
  2. When you get Page's .Hugo is deprecated you just need to change from something like .Hugo.Generator to hugo.Generator in your <head>.
  3. .GetParam is being deprecated, so see if you can just access the param directly. For example, indicating what posts are in draft form:
// before
{{ if .GetParam "draft"}}<span class="bg-orange white">DRAFT</span>{{end}}
// after
{{ if .Site.BuildDrafts }}{{ if .Draft }}<span class="bg-orange white">DRAFT</span>{{ end }}{{ end }} 

RC Logr 20190409 144438 - After upgrading to static site … Rick Cogley
Back to Home Tweet Link