devcows / hugo-universal-theme

Universal theme for Hugo, it stands out with its clean design and elegant typography.
https://devcows.github.io/hugo-universal-theme
MIT License
788 stars 559 forks source link

Cannot build on latest hugo #395

Open 1ridic opened 9 months ago

1ridic commented 9 months ago
Start building sites … 
hugo v0.120.1+extended linux/amd64 BuildDate=unknown

ERROR render of "term" failed: template: _internal/_default/rss.xml:3:9: executing "_internal/_default/rss.xml" at <site>: can't evaluate field email in type string
ERROR render of "section" failed: template: _internal/_default/rss.xml:3:9: executing "_internal/_default/rss.xml" at <site>: can't evaluate field email in type string
ERROR render of "taxonomy" failed: template: _internal/_default/rss.xml:3:9: executing "_internal/_default/rss.xml" at <site>: can't evaluate field email in type string
Built in 67 ms
Error: error building site: render: failed to render pages: render of "home" failed: template: _internal/_default/rss.xml:3:9: executing "_internal/_default/rss.xml" at <site>: can't evaluate field email in type string

ref: https://discourse.gohugo.io/t/render-of-section-failed-cannot-find-the-template-that-has-the-error/46883

ryanfox1985 commented 7 months ago

it works fine in my end:

version: hugo v0.121.2+extended linux/amd64
> hugo server
Watching for changes in /home/guillermo/workspace/hugo-universal-theme/{archetypes,exampleSite,i18n,layouts,package.json,static}
Watching for config changes in /home/guillermo/workspace/hugo-universal-theme/exampleSite/config.toml
Start building sites … 
hugo v0.121.2+extended linux/amd64 BuildDate=unknown

                   | EN   
-------------------+------
  Pages            |  43  
  Paginator pages  |   0  
  Non-page files   |   0  
  Static files     | 105  
  Processed images |   0  
  Aliases          |  17  
  Sitemaps         |   1  
  Cleaned          |   0  

Built in 70 ms
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/hugo-universal-theme/ (bind address 127.0.0.1) 
Press Ctrl+C to stop
al3xandru commented 7 months ago

This is with a clean clone:

WARN  calling IsSet with unsupported type "invalid" (<nil>) will always return false.
ERROR render of "page" failed: "~/themes/universal/layouts/_default/single.html:35:65": execute of template failed: template: _default/single.html:35:65: executing "_default/single.html" at <.Site.Params.date_format>: invalid value; expected string
ERROR render of "section" failed: "~/themes/universal/layouts/_default/list.html:59:75": execute of template failed: template: _default/list.html:59:75: executing "_default/list.html" at <.Site.Params.date_format>: invalid value; expected string
ERROR render: failed to render pages: render of "page" failed: "~/themes/universal/layouts/_default/single.html:35:65": execute of template failed: template: _default/single.html:35:65: executing "_default/single.html" at <.Site.Params.date_format>: invalid value; expected string
Rebuilt in 51 ms
ryanfox1985 commented 7 months ago

still not reproduccing the error:

image
matthewcornell commented 3 weeks ago

Following @ryanfox1985 steps, I get a different error:

ERROR deprecated: .Site.DisqusShortname was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0. Use .Site.Config.Services.Disqus.Shortname instead.

cd ~/IdeaProjects/
git clone https://github.com/devcows/hugo-universal-theme.git
cd hugo-universal-theme
cd exampleSite
hugo serve
Watching for changes in /Users/cornell/IdeaProjects/hugo-universal-theme/{archetypes,exampleSite,i18n,layouts,package.json,static}
Watching for config changes in /Users/cornell/IdeaProjects/hugo-universal-theme/exampleSite/config.toml
Start building sites … 
hugo v0.132.0+extended darwin/arm64 BuildDate=2024-08-12T15:21:36Z VendorInfo=brew

ERROR deprecated: .Site.DisqusShortname was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0. Use .Site.Config.Services.Disqus.Shortname instead.
Built in 87 ms
Error: error building site: logged 1 error(s)

I worked around it by replacing the two occurrences I found with the suggestion:

image
Magneticdud commented 3 weeks ago

PR #406 fixes the latest error due to that disqus deprecation, which happened one version earlier than what the message says

hopefully it can be merged soon

meanwhile, for a quick fix, copy those files from the PR in /layout to override the ones in the theme