Issue while upgrading the Hugo and Docsy

Team,

I have upgraded the Hugo with the latest version “0.117.0” and copy pasted the Docsy’s latest version(0.7.1) in the site/themes/docsy folder of the project repo.

CI build is failing with below error,

ERROR render of "page" failed: "/go/src/agones.dev/agones/site/themes/docsy/layouts/blog/baseof.html:4:7": execute of template failed: template: blog/single.html:4:7: executing "blog/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:15:13: no such template "_internal/google_news.html"

Log - CI build · GitHub

Please let me know if any other information is required and help required to resolve this issue.

Thanks!

The “google-news” internal template was deprecated a few years ago, and the call to the “google-news” template was removed from Docsy on November 16, 2021:
https://github.com/google/docsy/commit/e806a47346c29f3fb6553c450da70d602c2526e8

So, whatever you did to update the theme didn’t work.

Thanks for the quick response! I have excluded the “{{- template “_internal/google_news.html” . -}}” template from head.html files and resolved the google_news related issue. However, I am still facing issues,

Error: error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): "/go/src/agones.dev/agones/site/themes/docsy/assets/scss/support/_bootstrap_vers_test.scss:3:3": 

Log - CI build · GitHub

May I know the proper way to upgrade the Hugo and Docsy? We aren’t interested in git submodules and preferring just copy-paste of Docsy or any other options…

This doesn’t make sense if you have “copy pasted the Docsy’s latest version” because that line of code does not exist:

https://github.com/google/docsy/blob/9f4b873da468ccadaaa54d30c6aba71954508c4a/layouts/partials/head.html#L25-L27

You already have. Your build log shows v0.117.0.
https://gist.github.com/Kalaiselvi84/094258435ecd7d9f7be19dfd8b5ae9de#file-gistfile1-txt-L423

See https://www.docsy.dev/docs/get-started/.

This template was present in site/layouts/partials/head.html file and not in site/themes/docsy/layouts/partials/head.html in the upgraded version.

I was playing around with the before upgrade & after upgrade code. Before upgrade code has it and also I have to use “{{ template “_internal/google_analytics.html” . }}” instead “{{ template “_internal/google_analytics_async.html” . }}” template.

Anything in your project’s layout directory overrides the same template in a theme. Or to put it another way, if you override a theme template, updating the theme has no effect.

Hi @jmooring,

Could you please share the solution for the below error if possible?

Error: error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): "/go/src/agones.dev/agones/site/themes/docsy/assets/scss/support/_bootstrap_vers_test.scss:3:3": 
  Docsy requires Bootstrap v5, but the v5 variable
  $enable-important-utilities isn't defined.
  Did you forget to update Docsy dependencies?

How are we ensuring that the dependency for the Bootstrap to v5 is available?

PR - Upgrade Hugo and Docsy by Kalaiselvi84 · Pull Request #3351 · googleforgames/agones · GitHub

Please ask your question here:
https://github.com/google/docsy/discussions

I agree with @jmooring that you’re better off asking about this process with Docsy’s group, but as a general rule, that error comes up commonly when migrating Docsy from pre-0.7 to later and failing to re-run npm install in the /themes/docsy/ folder. It’s an indication that the NPM dependancies aren’t as expected for the SCSS build to work.

Having not yet gained a comprehensive understanding of your build process to figure out what differences to a typical build you’ve made, I can’t be more precise here, and thus point you back at the Docsy group.

Thank you for your assistance. I’ve initiated a conversation with the Docsy group.

Hello Team,

I hope this message finds you well. Right now I am trying to upgrade Hugo to version v0.118.2. During testing, I encountered an error while attempting to use the site-server target to check the Agones site locally. You can find the relevant code snippet and error details below:
site-server target.

Here’s a summary of the error message:

Error: error building site: "/go/src/agones.dev/agones/site/content/en/docs/Installation/Terraform/aks.md:14:2": failed to render shortcode "ghlink": failed to process shortcode: "/go/src/agones.dev/agones/site/layouts/shortcodes/ghlink.html:1:40": execute of template failed: template: shortcodes/ghlink.html:1:40: executing "shortcodes/ghlink.html" at <getenv "RELEASE_BRANCH">: error calling getenv: access denied: "RELEASE_BRANCH" is not whitelisted in policy "security.funcs.getenv"; the current security configuration is:

[security]
  enableInlineShortcodes = false

  [security.exec]
    allow = ['^(dart-)?sass(-embedded)?

I’ve made an attempt to resolve this issue by adding the following configuration to the config.toml file:

[security.funcs.getenv]
  getenv = ['^HUGO_', '^CI$', '^RELEASE_BRANCH$']

However, this did not resolve the error. I kindly request your guidance and assistance in resolving this matter. Your expertise would be greatly appreciated.

Thank you for your time and assistance.

You’re pointing to security.funcs.getenv.getenv instead of security.funcs.getenv because you have the key with security.funcs.getenv as well as getenv =.

Try (untested):

[security.funcs]
getenv = …

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