kubeflow / website

Kubeflow's public website
Creative Commons Attribution 4.0 International
146 stars 766 forks source link

Fix missing google_analytics_async.html template preventing hugo to run locally. #3829

Closed franciscojavierarceo closed 1 week ago

franciscojavierarceo commented 1 month ago

I was getting started with the website and following the instructions on running hugo locally and I received the following error:

[master]% hugo server -D
Watching for changes in /Users/farceo/dev/website/{assets,content,layouts,package.json,static,themes}
Watching for config changes in /Users/farceo/dev/website/config.toml, /Users/farceo/dev/website/themes/docsy/config.yaml
Start building sites …
hugo v0.129.0+extended darwin/arm64 BuildDate=2024-07-17T13:29:16Z VendorInfo=brew

ERROR render of "section" failed: "/Users/farceo/dev/website/themes/docsy/layouts/docs/baseof.html:4:7": execute of template failed: template: docs/list.html:4:7: executing "docs/list.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:65:16: no such template "_internal/google_analytics_async.html"
ERROR render of "page" failed: "/Users/farceo/dev/website/themes/docsy/layouts/docs/baseof.html:4:7": execute of template failed: template: docs/single.html:4:7: executing "docs/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:65:16: no such template "_internal/google_analytics_async.html"
Built in 345 ms
Error: error building site: render: failed to render pages: render of "page" failed: "/Users/farceo/dev/website/themes/docsy/layouts/docs/baseof.html:4:7": execute of template failed: template: docs/single.html:4:7: executing "docs/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:65:16: no such template "_internal/google_analytics_async.html"

Looking at the _internal/ path I see that the google_analytics_async.html file doesn't exist.

I added an empty file and then things worked just file but I wanted to confirm that this wasn't on purpose.

The fix would be to delete the references to the template or add the file with the real template. Happy to make a fix.

thesuperzapper commented 1 month ago

@franciscojavierarceo I don't get an issue when using the correct version of Hugo.

Please downgrade your Hugo to 0.124.1, as described in Install Hugo and confirm if you still have a problem.

thesuperzapper commented 1 week ago

An update for others if they see this issue was just that they had not run git submodule update --init --recursive, so were running an old version of the Docsy template.