Several problems I ran in to while trying out gohugo

Several problems I ran into as a novice gohugo user.

  • the quickstart example does not work.
  • some content fails to render without any error message
  • don’t name your post ‘index.md’
  • posts without a frontmatter are not clickable, but do show in the index.
  • the ‘more’ looks like another post, while it is intended as a summary of ‘other’ posts.
  • no date in frontmatter the year 1 is assumed.
  • Overly complicated error messages:
  • it was not clear to me at first that you do need the extra subdirectory level under contents.
  • how do i select what part of my post i want in the summary.
  • The summaries are not always rendered properly, creating an ugly index page.

the quickstart example does not work.

hugo new posts/my-first-post.md

EITHER Mentions the wrong directory. In that case, it should read:

hugo new contents/mycategory/my-first-post.md

OR … hugo new should create the ‘posts’ directory as a subdirectory of ‘content’

Another issue, is that with the default archetypes/default.md posts don’t get ordered by date, it seems that the date should be quoted. Strange thing, later, using another theme, this problem sort of went away.

contents fails to render without any error message

…TODO … post an example here.

don’t name your post ‘index.md’

Your post will instead be the new main page.

posts without a frontmatter are not clickable, but do show

There is no warning.

the ‘more’ looks like another post, while it is intended as a summary of ‘other’ posts.

This was with the ananke theme.

when there is no date in frontmatter the year 1 is assumed.

Better would be to use the file date.

Overly complicated error messages:

Building sites … panic: no source found, 0

goroutine 195 [running]:
github.com/gohugoio/hugo/hugolib.(*pagesCollector).addToBundle.func2(0x58e1260, 0x2, 0x5902e57)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/pages_capture.go:360 +0x2c7
github.com/gohugoio/hugo/hugolib.(*pagesCollector).addToBundle(0xc0008647d0, 0x5d542a0, 0xc0009ef720, 0x1, 0xc0009c5f20, 0x20300000000000, 0x7dfffff)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/pages_capture.go:395 +0x6b3
github.com/gohugoio/hugo/hugolib.(*pagesCollector).handleBundleLeaf.func1(0xc0009fa0e9, 0x32, 0x5d542a0, 0xc0009ef720, 0x0, 0x0, 0xc000a65400, 0xc000a00b98)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/pages_capture.go:477 +0xa6
github.com/gohugoio/hugo/hugofs.(*Walkway).walk(0xc000874a20, 0xc0009fa0e9, 0x32, 0x5d542a0, 0xc0009ef720, 0x0, 0x0, 0x0, 0xc000af66c0, 0xc000a00d60, ...)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugofs/walk.go:175 +0x7a
github.com/gohugoio/hugo/hugofs.(*Walkway).walk(0xc000874a20, 0x0, 0x0, 0x5d542a0, 0xc0009eeaa0, 0xc0004f4dc0, 0x29, 0x29, 0xc000af66c0, 0x400e6d8, ...)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugofs/walk.go:298 +0x765
github.com/gohugoio/hugo/hugofs.(*Walkway).Walk(0xc000874a20, 0xc0003753a0, 0x0)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugofs/walk.go:136 +0x1cd
github.com/gohugoio/hugo/hugolib.(*pagesCollector).handleBundleLeaf(0xc0008647d0, 0x5d542a0, 0xc0009eeaa0, 0x0, 0x0, 0xc0004f4dc0, 0x29, 0x29, 0x1, 0xc00084eae0)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/pages_capture.go:490 +0x193
github.com/gohugoio/hugo/hugolib.(*pagesCollector).collectDir.func1(0x1, 0x5d542a0, 0xc0009eeaa0, 0x0, 0x0, 0xc0004f4dc0, 0x29, 0x29, 0xc000a01268, 0x4825f56)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/pages_capture.go:177 +0xae
github.com/gohugoio/hugo/hugolib.(*pagesCollector).collectDir.func3(0x5d542a0, 0xc0009eeaa0, 0x0, 0x0, 0xc0004f4dc0, 0x29, 0x29, 0x0, 0x567ed00, 0x5577040, ...)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/pages_capture.go:276 +0x50e
github.com/gohugoio/hugo/hugofs.(*Walkway).walk(0xc000874990, 0x0, 0x0, 0x5d542a0, 0xc0009eeaa0, 0xc0004f4dc0, 0x29, 0x29, 0x59dc110, 0x4825a7f, ...)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugofs/walk.go:281 +0x891
github.com/gohugoio/hugo/hugofs.(*Walkway).Walk(0xc000874990, 0xc0003753a0, 0x0)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugofs/walk.go:136 +0x1cd
github.com/gohugoio/hugo/hugolib.(*pagesCollector).collectDir(0xc0008647d0, 0x0, 0x0, 0x5d3f100, 0x0, 0x40fce60, 0xc00084e9c0)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/pages_capture.go:319 +0x34e
github.com/gohugoio/hugo/hugolib.(*pagesCollector).Collect(0xc0008647d0, 0xc0008647d0, 0xc0003753a0)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/pages_capture.go:115 +0x45b
github.com/gohugoio/hugo/hugolib.(*Site).readAndProcessContent(0xc0003f4e00, 0x0, 0x0, 0x0, 0x0, 0x0)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/site.go:1238 +0x188
github.com/gohugoio/hugo/hugolib.(*Site).process(0xc0003f4e00, 0x0, 0x0, 0x0, 0x0, 0xc000939730, 0x0, 0x0, 0x0, 0x0, ...)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/site.go:1061 +0x61
github.com/gohugoio/hugo/hugolib.(*HugoSites).process(0xc0004f7080, 0xc0009b45c0, 0xc000071bf0, 0x0, 0x0, 0x0, 0x402f84a, 0x7c4fd01)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:230 +0x127
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func2.2()
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:105 +0x64
runtime/trace.WithRegion(0x5d3f1e0, 0xc0009c4c00, 0x58f2930, 0x7, 0xc000071c18)
    /usr/local/Cellar/go/1.13.7/libexec/src/runtime/trace/annotation.go:137 +0x115
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func2(0x402f84a, 0x1)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:107 +0x162
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func3()
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:124 +0x2f
runtime/trace.WithRegion(0x5d3f1e0, 0xc0009c4c00, 0x58f28ce, 0x7, 0xc000071e48)
    /usr/local/Cellar/go/1.13.7/libexec/src/runtime/trace/annotation.go:137 +0x115
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build(0xc0004f7080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/hugolib/hugo_sites_build.go:126 +0x820
github.com/gohugoio/hugo/commands.(*commandeer).buildSites(...)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/commands/hugo.go:710
github.com/gohugoio/hugo/commands.(*commandeer).fullBuild.func3(0xc0008f7768, 0x2)
    /private/tmp/hugo-20200204-77776-1t93oty/hugo-0.64.0/src/github.com/gohugoio/hugo/commands/hugo.go:322 +0x96
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc0009c4bd0, 0xc000939700)
    /Users/brew/Library/Caches/Homebrew/go_cache/pkg/mod/golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e/errgroup/errgroup.go:57 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
    /Users/brew/Library/Caches/Homebrew/go_cache/pkg/mod/golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e/errgroup/errgroup.go:54 +0x66

how do i select what part of my post i want in the summary.

  • does hugo have a ‘more’ or ‘teaser’ tag?

    like:

Yes:

<!--more-->

is the subdir under ‘contents’ mandatory?

Apparently it is. this was not clear to me at first.

The summaries are not always rendered properly, creating an ugly index page.

for instance check out my posts: ‘a simple fix for the missing mipsel error’, which is not rendered properly, and ‘Hexdumper for C++ IOStreams’, which also has a code section, but that is rendered correctlu in the summary view.

The problem seems to be that when there is no ‘more’ tag, then the summary is rendeder differently than whan it is there.