Subpage missing from section's page list when using 0.123.8

The problem described below occurs when I build github.com/open-telemetry/opentelemetry.io.

The published website is currently building with Hugo 0.122.0. The problem I’m facing has to do with the page list of the “Logs” section:

When I build using Hugo 0.123.8, “OpenTelemetry LogRecord Exporter - Standard output” disappears from the page list – for a preview, see Logs page preview using Hugo 0.123.8.

The markdown files for the logs section (whose source is here) are setup as follows:

Note that the stdout page is in a subfolder that doesn’t have an index page. Could that be causing the problem? Thanks!

How do I build the site?

image

There’s nothing wrong with organizing section content in subdirectories. This works fine with v0.123.x.

After cloning the repo, you can build using Node 20+ by running:

npm install
npm run build

To serve, use: npm run serve.

Thanks for looking into this. If that doesn’t work out, I’ll try to get a smaller repro.

OK, I can reproduce this locally. I’ll try to look at this later today.

I’m glad that you were able to reproduce it. Thanks for looking into this issue.

Initial findings…

http://localhost:1313/docs/specs/otel/logs/sdk_exporters/stdout/ is published, and content matches live site.

So the question is, why doesn’t the link appear on http://localhost:1313/docs/specs/otel/logs/?

Right, that is what I noticed too: the page gets published, but isn’t in the list :man_shrugging:t3: :smile:

I’m having a difficult time following content and templates—this seems really complex. Can you tell me which template is rendering tmp/otel/specification/logs/_index.md?

More findings…

In themes/docsy/layouts/partials/section-index.html, if I comment out the lines as shown below…

    {{ $parent := .Page -}}
    {{ $pages := (where .Site.Pages "Section" .Section).ByWeight -}}
    {{ $pages = (where $pages "Type" "!=" "search") }}
    {{ $pages = (where $pages ".Params.hide_summary" "!=" true) -}}
    {{ $pages = (where $pages ".Parent" "!=" nil) -}}
    {{/*  
    {{ if and .Parent .Parent.File -}}
        {{ $pages = (where $pages "Parent.File.UniqueID" "==" $parent.File.UniqueID) -}}
    {{ end -}}
    */}}
    {{ if or $parent.Params.no_list (eq (len $pages) 0) -}}

… I get a really long list displayed on http://localhost:1313/docs/specs/otel/logs/, and that list includes

OpenTelemetry LogRecord Exporter - Standard output

So I assume that .Parent has changed between the two versions…


This file:
docs/specs/otel/logs/sdk_exporters/stdout.md

Has this parent with v0.122.0:
docs/specs/otel/logs/_index.md

And has this parent with v0.123.8:
docs/specs/otel/logs/sdk.md

And the latter doesn’t make any sense to me.


Maybe the mount behavior has changed:

  mounts:
    - source: content/en
      target: content
    - source: tmp/otel/specification
      target: content/docs/specs/otel

I haven’t figured out how to make a minimal example of this yet, and asking bep to work with this repo would be… unkind.

Hi @jmooring, thanks for the deep dive and diagnostics. Ok, I’ll work on creating a smaller repro.

1 Like

Here’s a small repro: test-site-2024-03-14.zip. Serve using Hugo 0.123.8 results in the Stdout page showing up in the left nav but not the section’s page list:

The same test site built with Hugo 0.122.0 shows the Stdout page in both places. Let me know how else I might be of assistance. Thanks

This is helpful. Thanks.


To reproduce the problem:

git clone --single-branch -b hugo-forum-topic-48789 https://github.com/jmooring/hugo-testing hugo-forum-topic-48789
cd hugo-forum-topic-48789
npm ci
hugo server

Then visit http://localhost:1313/docs/logs/ to see the problem.

You will see “Stdout” in the menu on the left, but that page is not shown in the content listing.

In the interest of tracking forum topics related to v0.123.x that do not have a corresponding GitHub issue, I am marking this resolved.

See https://github.com/gohugoio/hugo/issues/12263.

1 Like

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