cue-lang / docs-and-content

A place to discuss, plan, and track documentation on cuelang.org
6 stars 1 forks source link

docs: various failures when running ./_scripts/serve.bash #99

Closed NoamTD closed 8 months ago

NoamTD commented 8 months ago

when running ./_scripts/serve.bash locally on the current alpha branch, the script fails on my machine

hugo version: hugo v0.123.8-5fed9c591b694f314e5939548e11cc3dcb79a79c+extended darwin/arm64 BuildDate=2024-03-07T13:14:42Z VendorInfo=brew

There are two types of failures:

REF_NOT_FOUND

example error:

debug: hugo: ERROR [en] REF_NOT_FOUND: Ref "../validate-yaml-using-cue": "/Users/noamd/src/cue-lang/cuelang.org/hugo/content/en/docs/howto/use-encoding-yaml-validate-encoding-yaml-validatepartial-as-field-validators/index.md:1:1": page not found

This appears for the following files:

For some reason the relative path does not work. Adding a "/index.md" suffix resolved the issue, but I don't think this is ideal.

url parse error

I'm getting this error:

debug: hugo: Error: error building site: render: failed to render pages: render of "page" failed: "/Users/noamd/src/cue-lang/cuelang.org/hugo/layouts/docs/single.html:8:19": execute of template failed: template: docs/single.html:8:19: executing "main" at <partial "schema/article.html" .>: error calling partial: "/Users/noamd/src/cue-lang/cuelang.org/hugo/layouts/partials/schema/article.html:1:41": execute of template failed: template: partials/schema/article.html:1:41: executing "partials/schema/article.html" at <.Content>: error calling Content: "/Users/noamd/src/cue-lang/cuelang.org/hugo/content/en/docs/howto/use-list-avg-list-max-list-min-list-sum-to-summarise-lists-of-numbers/index.md:1:1": execute of template failed: template: _default/_markup/render-link.html:1:14: executing "_default/_markup/render-link.html" at <urls.Parse>: error calling Parse: parse "://pkg.go.dev/cuelang.org/go/pkg/list": missing protocol scheme

This appears to be caused by a typo in https://github.com/cue-lang/cuelang.org/blob/40ab37ffd420985a4222ccf05599bec0d4975828/content/docs/howto/use-list-avg-list-max-list-min-list-sum-to-summarise-lists-of-numbers/en.md?plain=1#L12 - the https scheme is missing from the url

jpluscplusm commented 8 months ago

Thanks for opening this, @NoamTD. I can replicate this problem ... but only after upgrading Hugo from 0.122.something. I guess Hugo tightened up something in their source validation logic that earlier versions missed, and allowed these mistakes to creep into the site's code :-)

I'll fix these up.

jpluscplusm commented 8 months ago

This issue is partially fixed in https://cuelang.org/cl/1177978, and https://cuelang.org/cl/1177974 is a follow-up that upgrades Hugo to the latest version (0.123.8).

Do note that the upgrade to Hugo might not be prioritised and performed immediately. Until it's complete, you'll need to run Hugo <=0.122 locally to build the site successfully, as the markup changes introduced in CL1177974 aren't backwards compatible.

jpluscplusm commented 8 months ago

@myitcv Please migrate this issue to cue-lang/cue.

NoamTD commented 8 months ago

got it. Thank you for the quick response!

jpluscplusm commented 8 months ago

Closed via https://github.com/cue-lang/cuelang.org/commit/0652400403579005fb3f973ead6d3d6bf832a713, which upgrades the site's Hugo to 0.123.8 and fixes the content issues noticed by @NoamTD. Thanks, Noam!