Hugo

Updating a Content page broke multiple ref links

I’ve struggled a lot with ref and relref commands, but I had finally got things to link correctly. Now, I updated a page to fill content, but it broke the links to several other pages. For some reason, the update to that page prevented an entire section of content pages from being generated, but I can’t tell exactly why. Here is the commit that broke the build: https://gitlab.com/princeton-infosec/www/-/jobs/272717406

I’m not sure if I’m misunderstanding the use of sections/index pages in the directory structure, but it seems very finicky. Can anyone tell me what broke with that commit?

Another strange and interesting part of this is that it builds correctly on my local machine…

$ hugo version
Hugo Static Site Generator v0.56.3/extended windows/amd64 BuildDate: unknown

When I remove the links from the https://gitlab.com/princeton-infosec/www/blob/d08109520b2eb66aa6ea07e00f0a00fa0468c622/content/assignments.md file, then the build is successful, but it does not build any of the assignment pages (i.e., in assignments/*.html). Instead, it builds a default index page and creates a directory in assignments/page/1/index.html.

In my attempts to figure this out, I found that it wasn’t my commit that broke anything. If I revert back to the last successfully built commit, it is still broken:

$ git checkout 836e540e
HEAD is now at 836e540 update minor static content meta
$ hugo
Building sites … ERROR 2019/08/14 19:06:44 [en] REF_NOT_FOUND: Ref "a1_prg": "/home/jeichenhofer/infosec_repos/www/content/assignments.md:15:32": page not found
ERROR 2019/08/14 19:06:44 [en] REF_NOT_FOUND: Ref "a2_asymmetric": "/home/jeichenhofer/infosec_repos/www/content/assignments.md:16:32": page not found
ERROR 2019/08/14 19:06:44 [en] REF_NOT_FOUND: Ref "a3_authenticated_channel": "/home/jeichenhofer/infosec_repos/www/content/assignments.md:17:30": page not found
ERROR 2019/08/14 19:06:44 [en] REF_NOT_FOUND: Ref "a4_network_security": "/home/jeichenhofer/infosec_repos/www/content/assignments.md:18:25": page not found
ERROR 2019/08/14 19:06:44 [en] REF_NOT_FOUND: Ref "a5_web_security": "/home/jeichenhofer/infosec_repos/www/content/assignments.md:19:21": page not found
ERROR 2019/08/14 19:06:44 [en] REF_NOT_FOUND: Ref "a6_forensics": "/home/jeichenhofer/infosec_repos/www/content/assignments.md:20:26": page not found
Total in 294 ms
Error: Error building site: logged 6 error(s)

Naturally, I checked to see if there was an update between my two builds… https://github.com/gohugoio/hugo/releases/tag/v0.57.0

So, at least there’s a direction to pursue, but I still need help… Should I open a new topic to see how this update broke my build?

Hi,

So there’s a few things I want to point out:

  1. You have both
    1.1. content/assignments.md and
    1.2. content/assignments/...
    and I am guessing there’s gonna be some collisions here, as 1.1 is a regular page and 1.2 is (I’m guessing intended to be) a section page. Hugo will try to render yoursite.com/assignments/ as one or the other. In fact when I try to run your site, I get different results on navigating to http://localhost:1313/www/assignments/: the section page version with a list of the child contents; the regular page-type with the table in content/assignments.md.

I can only guess what you actually want here; but I would suggest that you move the current content/assignments.md to content/assignments/_index.md. That markdown table would then be the .Content for /assignments/_index.md and should show up before the list of child content when you navigate to http://localhost:1313/www/assignments/.

Read more about content organisation here: https://gohugo.io/content-management/organization/

  1. Your config has the following taxonomies definition:
[taxonomies]
  tag = ""
  group = ""
  category = ""

This is not the correct way to disable generating taxonomies; this might be causing unintended results and errors as well. This is how you are supposed to do it: https://gohugo.io/content-management/taxonomies/#default-taxonomies

2 Likes

That did it. I did not understand how the “_index.md” pages worked with the “list.html” template. I’ve updated everything (including the taxonomy disabling stuff), and now it builds successfully and appears to have the content as I want it. Thank you.