Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: error building site: render: failed to render pages #639

Open
sebastian-luna-valero opened this issue Feb 26, 2024 · 7 comments
Open

Comments

@sebastian-luna-valero
Copy link
Member

Short Description of the issue

Following https://docs.egi.eu/about/contributing/git/#run-the-site-locally

I was testing https://github.com/gohugoio/hugo/releases/tag/v0.123.3

I got the below error when building the site:

$ hugo --minify
WARN  DEPRECATED: Kind "taxonomyterm" used in disableKinds is deprecated, use "taxonomy" instead.
WARN  deprecated: config: languages.en.description: custom params on the language top level was deprecated in Hugo v0.112.0 and will be removed in a future release. Put the value below [languages.en.params]. See https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120
Start building sites … 
hugo v0.123.3-a75a659f6fc0cb3a52b2b2ba666a81f79a459376 linux/amd64 BuildDate=2024-02-23T17:09:20Z VendorInfo=gohugoio

ERROR render of "section" failed: "/home/sebastian/devel/EGI-Federation/documentation-2024-02-26/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:20:13: no such template "_internal/google_news.html"
Total in 320 ms
Error: error building site: render: failed to render pages: render of "page" failed: "/home/sebastian/devel/EGI-Federation/documentation-2024-02-26/themes/docsy/layouts/_default/baseof.html:4:7": execute of template failed: template: _default/single.html:4:7: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:20:13: no such template "_internal/google_news.html"

Summary of proposed changes

@sebastian-luna-valero
Copy link
Member Author

@sebastian-luna-valero
Copy link
Member Author

Ok, so the deprecation warnings can be removed with:

diff --git a/config.toml b/config.toml
index 6243e825dc..af510abab2 100644
--- a/config.toml
+++ b/config.toml
@@ -16,7 +16,7 @@ defaultContentLanguageInSubdir = false
 # Useful when translating.
 enableMissingTranslationPlaceholders = false
 
-disableKinds = ["taxonomy", "taxonomyTerm"]
+disableKinds = ["taxonomy"]
 
 # Highlighting config
 pygmentsCodeFences = true
@@ -63,10 +63,12 @@ anchor = "smart"
 [languages]
   [languages.en]
   title = "Documentation"
-  description = "EGI documentation"
   languageName = "English"
   # Weight used for sorting.
   weight = 1
+    [languages.en.params]
+    description = "EGI documentation"
+
 
 [markup]
   [markup.goldmark]

@sebastian-luna-valero
Copy link
Member Author

However, the issue is with docsy instead. Not sure how to solve that one.

@sebastian-luna-valero sebastian-luna-valero changed the title config: languages.en.description Error: error building site: render: failed to render pages Feb 26, 2024
@brucellino
Copy link
Member

@sebastian-luna-valero It's probably a good idea to pin the version of the module we're using, since it's pulling directly from the main branch of the upstream repo which the maintainers themselves say is volatile.

I got this working with: 1.123.4 and docsy 0.9.1 (same deprecation warning, but no error)

@sebastian-luna-valero
Copy link
Member Author

Thanks @brucellino

I updated hugo to https://github.com/gohugoio/hugo/releases/tag/v0.123.4 and got a different error now:

Error: "/home/sebastian/devel/EGI-Federation/documentation/layouts/shortcodes/tabx.html:2:1": parse failed: template: shortcodes/tabx.html:2: unterminated quoted string

Sorry, how can I pin docsy to 0.9.1? I think I get it installed with:

git submodule update --init --recursive --depth 1

which seems to get:

Submodule path 'themes/docsy': checked out 'f85c845226f30a4b2a55085d142e96def89e4c3f'

@brucellino
Copy link
Member

I updated hugo to https://github.com/gohugoio/hugo/releases/tag/v0.123.4 and got a different error now:

Error: "/home/sebastian/devel/EGI-Federation/documentation/layouts/shortcodes/tabx.html:2:1": parse failed: template: shortcodes/tabx.html:2: unterminated quoted string

Prettier broke the template:

-{{ with $.Parent }}
-{{ if ne $.Parent.Name "tabpanex" }}
-{{ errorf "tabx must be used within a tabpanex block" }}
-{{ end }}
-{{ end }}
+{{ with $.Parent }} {{ if ne $.Parent.Name "tabpanex" }} {{ errorf "tabx must be
+used within a tabpanex block" }} {{ end }} {{ end }}
 
 <!-- Prefill header if not given as parameter -->
 {{ $header := default (printf "Tab %v" ( add $.Ordinal 1)) (.Get "header") }}
 
 <!-- store all tab info in dict tab -->
-{{ $tab := dict "header" $header }}
-{{ with $.Inner }}
-{{ $tab = merge $tab (dict "content" $.Inner) }}
-{{ end }}
+{{ $tab := dict "header" $header }} {{ with $.Inner }} {{ $tab = merge $tab
+(dict "content" $.Inner) }} {{ end }}
 
 <!-- add dict tab to parent's scratchpad -->
-{{ with .Parent }}
-{{ $.Parent.Scratch.SetInMap "tabs" (printf "%v" $.Ordinal) $tab }}
-{{ end }}
+{{ with .Parent }} {{ $.Parent.Scratch.SetInMap "tabs" (printf "%v" $.Ordinal)
+$tab }} {{ end }}

My bad - I forgot to include layous/** (there were only the partials included in the orginal prettier config).
I've tested and it works. If you like, I can push the update to the branch you're working on, or you can just apply this patch in .prettierrc.toml:

 [[overrides]]
-files = ["layouts/partials/*.html"]
+files = ["layouts/**/*.html"]

This is a different story though:

Sorry, how can I pin docsy to 0.9.1? I think I get it installed with:

git submodule update --init --recursive --depth 1

Docsy's own documentation recommends using Hugo modules, which I would vastly prefer to using a submodule. I tried it last night, and:

  1. It works
  2. It removes ~ 80M from the repo
  3. We can explicitly declare the dependency and pin the version hugo mod get github.com/google/docsy@v0.9.1

I will propose in a new issue a move from using the submodule to using a hugo module which we can better manage.

@sebastian-luna-valero
Copy link
Member Author

I can push the update to the branch you're working on

Please push to https://github.com/brucellino/egi-documentation/tree/main so it stays on the same PR

I will propose in a new issue a move from using the submodule to using a hugo module which we can better manage.

Thank you very much, really appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants