Hugo server -D doesn't show new posts consistently

Using Arch Linux hugo v0.124.1+extended linux/amd64 BuildDate=unknown, Mainroad theme (updated this morning).

I have hugo running as a server locally when I update my blog:

hugo server --watch \
        --buildDrafts \
        --debug --verbose --logLevel debug

When I create a new post with hugo new content posts/new-post.md,
the hugo server doesn’t show the new post in the front page list, or in “Recent Posts” or under the two default tags I have set, but only under the “Posts” menu bar (localhost:1313/posts/). I’m certain that posts created with hugo new used to show up almost immediately in my web browser, and in the “tags” pages.

If I have a (firefox) web browser with localhost:1313 loaded, I see the browser “flash” when I do the hugo new content, which I believe is the HTML re-loading from the local hugo server.

The xterm in which I have hugo server running says this:

DEBUG Received System Events: [CREATE        "/home/bediger/nblog/content/posts/new-post.md" WRITE         "/home/bediger/nblog/content/posts/new-post.md" WRITE         "/home/bediger/nblog/content/posts/new-post.md" WRITE         "/home/bediger/nblog/content/posts/new-post.md"]

Change detected, rebuilding site (#1).
2024-04-10 09:46:48.455 -0600
DEBUG cachebuster: Matching "content/posts/new-post.md" with source "(postcss|tailwind)\\.config\\.js": no match
DEBUG cachebuster: Matching "content/posts/new-post.md" with source "(postcss|tailwind)\\.config\\.js": no match
Source changed /posts/new-post.md
DEBUG 
INFO  build:  step process substep resolve page output change set changes 0 checked 0 matches 0 duration 495.254µs
INFO  build:  step process substep gc dynacache duration 1.492073ms
INFO  build:  step process substep collect files 1 files_total 1 duration 3.585445ms
INFO  build:  step process duration 6.350306ms
DEBUG Direct dependencies of "/posts" (*hugolib.pageState page-287) =>
          _internal/shortcodes/ref.html
          /
          _default/_markup/render-link.html

I’m not sure that’s important though.

I have tried creating a new site with hugo new site, populating it with the markdown files from my posts, and I get the same result.

I have gone through the config.toml file section by section, and nothing seems to affect the new-post-not-showing.

I have tried running hugo server with --renderToMemory and --disableFastRender flags, same result. Post created with hugo new content posts/... only shows up in localhost:1313/posts

I’ll look at this in the next couple of days, but for future reference you can replace this:

hugo server --watch --buildDrafts --debug --verbose --logLevel debug

with this:

hugo server --buildDrafts --logLevel debug

Why?

  1. --debug has been deprecated, and you’re already specifying --logLevel debug.
  2. --verbose has been deprecated, and you’re already specifying --logLevel debug.
  3. Using --watch with hugo server is superfluous. That’s what hugo server does by default… it watches.

This is a regression; see https://github.com/gohugoio/hugo/issues/12362.

It was fixed in v0.125.0.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.