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

Manual testing of Hugo 0.55 (Help Wanted!) #5784

Closed
bep opened this issue Mar 24, 2019 · 53 comments
Closed

Manual testing of Hugo 0.55 (Help Wanted!) #5784

bep opened this issue Mar 24, 2019 · 53 comments
Labels
Milestone

Comments

@bep
Copy link
Member

bep commented Mar 24, 2019

See:

The important bits of that release is now implemented and merged to master.

I have tested this extensively manually myself, but I would really appreciate that you if you know how to compile Hugo from source, can take this for a spin on your site.

It's cool if you also test the "new stuff", but I'm mostly curious about if this somehow breaks anything in your site. And if it somehow breaks for you, access to the source code so I could see how and what would be gold. I'm not looking for more feature requests (as in "it would be cool if that also ...") as this has already been one of the most work-intensive releases.

I would strongly recommend that you build with the latest Go 1.12.1.

@bep bep added this to the v0.55 milestone Mar 24, 2019
@onedrawingperday
Copy link
Contributor

@bep

First of all in the latest production deploy of Hugo Themes we have 4 broken theme demos due to errors.

When I build the Themes Site locally with Hugo 0.55 DEV with the latest commits especially the gargantuan Make Page An Interface there is a jump to 27 errors from above.

Here is a typical ERROR message:

<.Page.IsHome>: can't evaluate field Page in type *hugolib.pageState

And typically in a template an author has entered .Page.IsHome

And here is the log with most of themes that fail to have demos generated in 0.55 DEV (I have included the ones that have meaningful error messages that point to specific templates)

ERROR 2019/03/24 21:55:44 render of "section" failed: "/home/alex/work/src/hugoThemes/hugo-dgraph-theme/layouts/_default/list.html:6:20": execute of template failed: template: _default/list.html:6:20: executing "_default/list.html" at <.Page.Kind>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-dgraph-theme
===
ERROR 2019/03/24 21:55:47 render of "home" failed: execute of template failed: template: index.html:3:8: executing "index.html" at <partial "_shared/hea...>: error calling partial: "/home/alex/work/src/hugoThemes/mediumish-gohugo-theme/layouts/partials/_shared/head.html:8:16": execute of template failed: template: partials/_shared/head.html:8:16: executing "partials/_shared/head.html" at <.Page.Title>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for mediumish-gohugo-theme
===
ERROR 2019/03/24 21:55:58 render of "page" failed: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/_default/baseof.html:2:20": execute of template failed: template: _default/single.html:2:20: executing "_default/single.html" at <.Page.Language>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-theme-techdoc
===
ERROR 2019/03/24 21:56:14 render of "page" failed: "/home/alex/work/src/hugoThemes/hugo-tikva/layouts/_default/baseof.html:3:19": execute of template failed: template: _default/single.html:3:3: executing "_default/single.html" at <partial "head.html" ...>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-tikva/layouts/partials/head.html:3:19": execute of template failed: template: partials/head.html:3:19: executing "partials/head.html" at <.Page.Title>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-tikva
===
ERROR 2019/03/24 21:56:22 render of "page" failed: execute of template failed: template: post/single.html:5:11: executing "post/single.html" at <partial "post-header...>: error calling partial: "/home/alex/work/src/hugoThemes/ghostwriter/layouts/partials/post-header.html:17:61": execute of template failed: template: partials/post-header.html:17:61: executing "partials/post-header.html" at <.Page.ReadingTime>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for ghostwriter
===
ERROR 2019/03/24 21:57:03 render of "page" failed: "/home/alex/work/src/hugoThemes/hugo-theme-learn/layouts/_default/single.html:2:20": execute of template failed: template: _default/single.html:1:3: executing "_default/single.html" at <partial "header.html...>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-learn/layouts/partials/header.html:2:20": execute of template failed: template: partials/header.html:2:20: executing "partials/header.html" at <.Page.Language>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-theme-learn
===
ERROR 2019/03/24 21:57:04 render of "page" failed: "/home/alex/work/src/hugoThemes/hugo-theme-techlog-simple/layouts/_default/single.html:13:15": execute of template failed: template: _default/single.html:1:3: executing "_default/single.html" at <partial "header.html...>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techlog-simple/layouts/partials/header.html:13:15": execute of template failed: template: partials/header.html:13:15: executing "partials/header.html" at <.Page.IsHome>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-theme-techlog-simple
===
ERROR 2019/03/24 21:57:19 render of "page" failed: execute of template failed: template: _default/single.html:19:9: executing "header" at <partial "header" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-oldnew-mashup/layouts/partials/header.html:5:11": execute of template failed: template: partials/header.html:3:9: executing "partials/header.html" at <partial "menubar" .>: error calling partial: execute of template failed: template: partials/menubar.html:1:267: executing "partials/menubar.html" at <partial "sitemenu" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-oldnew-mashup/layouts/partials/sitemenu.html:5:11": execute of template failed: template: partials/sitemenu.html:5:11: executing "partials/sitemenu.html" at <.Page.Params.sitemen...>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-oldnew-mashup
===
ERROR 2019/03/24 21:57:44 render of "page" failed: execute of template failed: template: _default/single.html:2:7: executing "header" at <partial "page-single...>: error calling partial: "/home/alex/work/src/hugoThemes/hyde-hyde/layouts/partials/page-single/variables-init.html:1:4": execute of template failed: template: partials/page-single/variables-init.html:1:4: executing "partials/page-single/variables-init.html" at <$.Page.Scratch.Set>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hyde-hyde
===
ERROR 2019/03/24 21:57:51 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:3:4: executing "_default/list.html" at <partial "head.html" ...>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-mondrian-theme/layouts/partials/head.html:2:13": execute of template failed: template: partials/head.html:2:13: executing "partials/head.html" at <.Page.IsHome>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-mondrian-theme
===
ERROR 2019/03/24 21:57:53 render of "page" failed: "/home/alex/work/src/hugoThemes/simpleit-hugo-theme/layouts/_default/single.html:38:18": execute of template failed: template: _default/single.html:38:18: executing "main" at <.Page.Resources.GetM...>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for simpleit-hugo-theme
===
ERROR 2019/03/24 21:58:09 render of "home" failed: execute of template failed: template: _default/index.reveal.html:4:7: executing "_default/index.reveal.html" at <partial "layout/head...>: error calling partial: "/home/alex/work/src/hugoThemes/reveal-hugo/layouts/partials/layout/head.html:2:18": execute of template failed: template: partials/layout/head.html:2:18: executing "partials/layout/head.html" at <.Page.Title>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for reveal-hugo
===
ERROR 2019/03/24 21:58:11 render of "page" failed: execute of template failed: template: projects/single.html:24:19: executing "projects/single.html" at <partial "nav.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-introduction/layouts/partials/nav.html:5:27": execute of template failed: template: partials/nav.html:5:27: executing "partials/nav.html" at <.Page.IsHome>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-theme-introduction
===
ERROR 2019/03/24 21:58:40 render of "taxonomy" failed: "/home/alex/work/src/hugoThemes/hugo-nederburg-theme/layouts/taxonomy/tag.html:14:28": execute of template failed: template: taxonomy/tag.html:3:11: executing "taxonomy/tag.html" at <partial "head.html" ...>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-nederburg-theme/layouts/partials/head.html:14:28": execute of template failed: template: partials/head.html:3:3: executing "partials/head.html" at <partial "schema" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-nederburg-theme/layouts/partials/schema.html:14:28": execute of template failed: template: partials/schema.html:14:28: executing "partials/schema.html" at <.Page.Params.author>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-nederburg-theme
===
ERROR 2019/03/24 21:58:44 render of "page" failed: execute of template failed: template: _default/single.html:3:8: executing "_default/single.html" at <partial "head.html" ...>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-bingo/layouts/partials/head.html:4:24": execute of template failed: template: partials/head.html:4:24: executing "partials/head.html" at <.Page.Title>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-bingo
===
ERROR 2019/03/24 21:58:48 render of "page" failed: execute of template failed: template: _default/single.html:3:8: executing "_default/single.html" at <partial "head.html" ...>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-grapes/layouts/partials/head.html:4:24": execute of template failed: template: partials/head.html:4:24: executing "partials/head.html" at <.Page.Title>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-grapes
===
ERROR 2019/03/24 21:58:51 render of "page" failed: execute of template failed: template: _default/single.html:10:13: executing "_default/single.html" at <partial "table-of-co...>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-now/layouts/partials/table-of-contents.html:20:30": execute of template failed: template: partials/table-of-contents.html:20:30: executing "partials/table-of-contents.html" at <$.Page.File.LogicalN...>: can't evaluate field Page in type *hugolib.pageState
FAILED to create exampleSite for hugo-now
===
ERROR 2019/03/24 21:58:51 render of "page" failed: "/home/alex/work/src/hugoThemes/base16/layouts/_default/single.html:1:12": execute of template failed: template: _default/single.html:4:5: executing "_default/single.html" at <partial "article.htm...>: error calling partial: "/home/alex/work/src/hugoThemes/base16/layouts/partials/article.html:1:12": execute of template failed: template: partials/article.html:1:12: executing "partials/article.html" at <.Page>: can't evaluate field Page in type *hugolib.pageState
FAILED to create demo site for base16

Also the following ERROR is different to the ones above:

ERROR 2019/03/24 21:58:48 render of "page" failed: execute of template failed: template: posts/single.html:6:5: executing "posts/single.html" at <partial "docs/html-h...>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-book/layouts/partials/docs/html-head.html:8:26": execute of template failed: template: partials/docs/shared.html:8:26: executing "title$htmltemplate_stateRCDATA_elementTitle" at <humanize>: error calling humanize: unable to cast hugolib.fileInfo{bundleTp:0, ReadableFile:(*source.FileInfo)(0xc0002ba960), basePather:(*hugofs.LanguageFileInfo)(0xc00040cc80), overriddenLang:"", disabled:false} of type hugolib.fileInfo to string
FAILED to create exampleSite for hugo-book

P.S. Note that I hadn't noticed that the Discource topic was locked when I replied. Sorry for that.

@bep
Copy link
Member Author

bep commented Mar 24, 2019

@onedrawingperday thanks for testing these. I will look more closely at these tomorrow, but there are some commons ...

  • We had Page.Page wich did not make much sense to me (and it's not documented, but of course someone is using it ...)

@onedrawingperday
Copy link
Contributor

onedrawingperday commented Mar 24, 2019

@bep

You're welcome. I just want to say that what you did by changing Page into an Interface has some very tangible benefits. It's 23 themes that broke. If nothing can be done we will handle the breakage as we usually do, (me and @digitalcraftsman )

Have a look at the above but at the end of the day making Hugo better is what counts.

bep added a commit to bep/hugo that referenced this issue Mar 25, 2019
It was removed in 597e418 -- it's not documented, but it's used in too many real sites on the web.

See gohugoio#5784
bep added a commit to bep/hugo that referenced this issue Mar 25, 2019
@bep
Copy link
Member Author

bep commented Mar 25, 2019

@onedrawingperday I have pushed fixes to the 2 issues you mentioned. Note that the hugo-book theme still fails, but now with a different error:

 at <.Dir>: error calling Dir: runtime error: invalid memory address or nil pointer dereference

This relates to #5781 -- and I have not decided on what to do about that yet. In short:

  • .Dir and all the other embedded File methods on Page is deprecated (use .File.Dir) -- not doing that would make the Page interface the largest Go interface on the planet :-) You do get a nice warning message about it... If the .File is not nil.
  • .File can now be nil (which is why the above theme fails)
  • The fix in template would be to do something ala {{ with .File }}{{ .Dir }} {{end }}.
  • Consider making .File on .Page a zero value instead of nil #5781 is about avoiding the crashes while still making {{ with .File }}{{ .Dir }} {{end }} work as expexted.
  • I have, however, seen many logical flaws where people assume there is always a file that would probably to be good to get out into the open, but let's keep that discussion in Consider making .File on .Page a zero value instead of nil #5781

@onedrawingperday
Copy link
Contributor

Right. So when 0.55 is released we will quote from your post above because frankly we do not have the time to debug such complexities.

There is also this other theme that fails in 0.55-DEV because it creates a dictionary with all sorts of variables for an Algolia JSON: https://github.com/zhaohuabing/hugo-theme-cleanwhite/blob/master/layouts/_default/list.algolia.json#L6

And there may be other themes as well...

P.S. I will test your fixes later today and get back to you.

@bep
Copy link
Member Author

bep commented Mar 25, 2019

Yes -- I think what I'm saying about #5781 is that if the breaks in the wild get too noisy, then we adjust it to reduce work ... Possibly delay the problem for later.

@onedrawingperday
Copy link
Contributor

@bep

I still get 7 broken theme demos.

It depends on what you want to do with #5781
But i think we could handle the noise.

In any case if you want to check out these themes here is the console log:

 ==== PROCESSING  docdock  ====== 
Building site for theme docdock using default content to ../themeSite/static/theme/docdock/
ERROR 2019/03/25 17:54:04 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:13:9: executing "_default/list.html" at <partial (printf "%s/body-beforecontent.html" .Site.Params.themestyle) .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "File.BaseFileName" $header>: error calling where: reflect: Method on nil interface value
ERROR 2019/03/25 17:54:04 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:13:9: executing "_default/list.html" at <partial (printf "%s/body-beforecontent.html" .Site.Params.themestyle) .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "File.BaseFileName" $header>: error calling where: reflect: Method on nil interface value
ERROR 2019/03/25 17:54:04 render of "home" failed: execute of template failed: template: index.html:13:9: executing "index.html" at <partial (printf "%s/body-beforecontent.html" .Site.Params.themestyle) .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "File.BaseFileName" $header>: error calling where: reflect: Method on nil interface value
ERROR 2019/03/25 17:54:04 render of "page" failed: execute of template failed: template: _default/single.html:13:9: executing "_default/single.html" at <partial (printf "%s/body-beforecontent.html" .Site.Params.themestyle) .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "File.BaseFileName" $header>: error calling where: reflect: Method on nil interface value
Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:13:9: executing "_default/list.html" at <partial (printf "%s/body-beforecontent.html" .Site.Params.themestyle) .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "File.BaseFileName" $header>: error calling where: reflect: Method on nil interface value
FAILED to create exampleSite for docdock
 ==== PROCESSING  hugo-theme-techlog-simple  ====== 
Building site for theme hugo-theme-techlog-simple using default content to ../themeSite/static/theme/hugo-theme-techlog-simple/
ERROR 2019/03/25 17:54:00 render of "taxonomyTerm" failed: execute of template failed: template: _default/terms.html:1:3: executing "_default/terms.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techlog-simple/layouts/partials/header.html:25:42": execute of template failed: template: partials/header.html:25:42: executing "partials/header.html" at <$.File.Dir>: nil pointer evaluating source.File.Dir
ERROR 2019/03/25 17:54:00 render of "taxonomyTerm" failed: execute of template failed: template: _default/terms.html:1:3: executing "_default/terms.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techlog-simple/layouts/partials/header.html:25:42": execute of template failed: template: partials/header.html:25:42: executing "partials/header.html" at <$.File.Dir>: nil pointer evaluating source.File.Dir
ERROR 2019/03/25 17:54:00 render of "taxonomyTerm" failed: execute of template failed: template: _default/terms.html:1:3: executing "_default/terms.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techlog-simple/layouts/partials/header.html:25:42": execute of template failed: template: partials/header.html:25:42: executing "partials/header.html" at <$.File.Dir>: nil pointer evaluating source.File.Dir
ERROR 2019/03/25 17:54:00 render of "taxonomy" failed: "/home/alex/work/src/hugoThemes/hugo-theme-techlog-simple/layouts/_default/list.html:25:42": execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techlog-simple/layouts/partials/header.html:25:42": execute of template failed: template: partials/header.html:25:42: executing "partials/header.html" at <$.File.Dir>: nil pointer evaluating source.File.Dir
Error: Error building site: failed to render pages: render of "taxonomy" failed: "/home/alex/work/src/hugoThemes/hugo-theme-techlog-simple/layouts/_default/list.html:25:42": execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "header.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techlog-simple/layouts/partials/header.html:25:42": execute of template failed: template: partials/header.html:25:42: executing "partials/header.html" at <$.File.Dir>: nil pointer evaluating source.File.Dir
FAILED to create exampleSite for hugo-theme-techlog-simple
 ==== PROCESSING  hugo-theme-learn  ====== 
hugo-theme-learn is whitelisted
Building site for theme hugo-theme-learn using its own exampleSite to ../themeSite/static/theme/hugo-theme-learn/
WARN 2019/03/25 17:53:57 Page's .Hugo is deprecated and will be removed in a future release. Use the global hugo function.
WARN 2019/03/25 17:53:57 Page's .URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url.
WARN 2019/03/25 17:53:57 Page's .UniqueID is deprecated and will be removed in a future release. Use .File.UniqueID.
ERROR 2019/03/25 17:53:59 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "header.html" .>: error calling partial: execute of template failed: template: partials/header.html:39:7: executing "partials/header.html" at <partial "menu.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-learn/layouts/partials/menu.html:102:38": execute of template failed: template: partials/menu.html:102:38: executing "section-tree-nav" at <$currentNode.UniqueID>: error calling UniqueID: runtime error: invalid memory address or nil pointer dereference
Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:1:3: executing "_default/list.html" at <partial "header.html" .>: error calling partial: execute of template failed: template: partials/header.html:39:7: executing "partials/header.html" at <partial "menu.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-learn/layouts/partials/menu.html:102:38": execute of template failed: template: partials/menu.html:102:38: executing "section-tree-nav" at <$currentNode.UniqueID>: error calling UniqueID: runtime error: invalid memory address or nil pointer dereference
FAILED to create exampleSite for hugo-theme-learn
 ==== PROCESSING  hugo-theme-cleanwhite  ====== 
Building site for theme hugo-theme-cleanwhite using default content to ../themeSite/static/theme/hugo-theme-cleanwhite/
WARN 2019/03/25 17:53:56 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/03/25 17:53:56 Page's .URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url.
WARN 2019/03/25 17:53:56 Page's .RSSLink is deprecated and will be removed in a future release. Use the Output Format's link, e.g. something like: 
    {{ with .OutputFormats.Get "RSS" }}{{ . RelPermalink }}{{ end }}.
WARN 2019/03/25 17:53:56 found no layout file for "HTML" for "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/03/25 17:53:56 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/03/25 17:53:56 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/03/25 17:53:56 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/03/25 17:53:56 Page's .UniqueID is deprecated and will be removed in a future release. Use .File.UniqueID.
Error: Error building site: failed to render pages: render of "home" failed: "/home/alex/work/src/hugoThemes/hugo-theme-cleanwhite/layouts/_default/list.algolia.json:6:47": execute of template failed: template: _default/list.algolia.json:6:47: executing "_default/list.algolia.json" at <.UniqueID>: error calling UniqueID: runtime error: invalid memory address or nil pointer dereference
FAILED to create exampleSite for hugo-theme-cleanwhite
 ==== PROCESSING  hugo-theme-zen  ====== 
Building site for theme hugo-theme-zen using default content to ../themeSite/static/theme/hugo-theme-zen/
WARN 2019/03/25 17:53:55 Page's .Hugo is deprecated and will be removed in a future release. Use the global hugo function.
ERROR 2019/03/25 17:53:55 error: failed to transform resource: TOCSS: failed to transform "sass/mobile.scss" (text/x-scss): this feature is not available in your current Hugo version
ERROR 2019/03/25 17:53:55 error: failed to transform resource: TOCSS: failed to transform "sass/styles.scss" (text/x-scss): this feature is not available in your current Hugo version
ERROR 2019/03/25 17:53:55 error: failed to transform resource: TOCSS: failed to transform "sass/print.scss" (text/x-scss): this feature is not available in your current Hugo version
WARN 2019/03/25 17:53:55 Page's .UniqueID is deprecated and will be removed in a future release. Use .File.UniqueID.
ERROR 2019/03/25 17:53:55 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:27:3: executing "_default/list.html" at <partial "menu.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-zen/layouts/partials/menu.html:3:17": execute of template failed: template: partials/menu.html:3:17: executing "partials/menu.html" at <.UniqueID>: error calling UniqueID: runtime error: invalid memory address or nil pointer dereference
ERROR 2019/03/25 17:53:55 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:27:3: executing "_default/list.html" at <partial "menu.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-zen/layouts/partials/menu.html:3:17": execute of template failed: template: partials/menu.html:3:17: executing "partials/menu.html" at <.UniqueID>: error calling UniqueID: runtime error: invalid memory address or nil pointer dereference
ERROR 2019/03/25 17:53:55 render of "taxonomy" failed: execute of template failed: template: _default/list.html:27:3: executing "_default/list.html" at <partial "menu.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-zen/layouts/partials/menu.html:3:17": execute of template failed: template: partials/menu.html:3:17: executing "partials/menu.html" at <.UniqueID>: error calling UniqueID: runtime error: invalid memory address or nil pointer dereference
ERROR 2019/03/25 17:53:55 render of "taxonomy" failed: execute of template failed: template: _default/list.html:27:3: executing "_default/list.html" at <partial "menu.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-zen/layouts/partials/menu.html:3:17": execute of template failed: template: partials/menu.html:3:17: executing "partials/menu.html" at <.UniqueID>: error calling UniqueID: runtime error: invalid memory address or nil pointer dereference
Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:27:3: executing "_default/list.html" at <partial "menu.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-zen/layouts/partials/menu.html:3:17": execute of template failed: template: partials/menu.html:3:17: executing "partials/menu.html" at <.UniqueID>: error calling UniqueID: runtime error: invalid memory address or nil pointer dereference
FAILED to create exampleSite for hugo-theme-zen
 ==== PROCESSING  hugo-theme-techdoc  ====== 
Building site for theme hugo-theme-techdoc using default content to ../themeSite/static/theme/hugo-theme-techdoc/
WARN 2019/03/25 17:53:52 Page's .Hugo is deprecated and will be removed in a future release. Use the global hugo function.
WARN 2019/03/25 17:53:52 Page's .URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url.
ERROR 2019/03/25 17:53:52 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:4:4: executing "main" at <partial "edit-meta.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-meta.html:2:41": execute of template failed: template: partials/edit-meta.html:4:4: executing "partials/edit-meta.html" at <partial "edit-page.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-page.html:2:41": execute of template failed: template: partials/edit-page.html:2:41: executing "partials/edit-page.html" at <$.File.Path>: nil pointer evaluating source.File.Path
ERROR 2019/03/25 17:53:52 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:4:4: executing "main" at <partial "edit-meta.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-meta.html:2:41": execute of template failed: template: partials/edit-meta.html:4:4: executing "partials/edit-meta.html" at <partial "edit-page.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-page.html:2:41": execute of template failed: template: partials/edit-page.html:2:41: executing "partials/edit-page.html" at <$.File.Path>: nil pointer evaluating source.File.Path
ERROR 2019/03/25 17:53:52 render of "taxonomy" failed: execute of template failed: template: _default/list.html:4:4: executing "main" at <partial "edit-meta.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-meta.html:2:41": execute of template failed: template: partials/edit-meta.html:4:4: executing "partials/edit-meta.html" at <partial "edit-page.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-page.html:2:41": execute of template failed: template: partials/edit-page.html:2:41: executing "partials/edit-page.html" at <$.File.Path>: nil pointer evaluating source.File.Path
ERROR 2019/03/25 17:53:52 render of "taxonomy" failed: execute of template failed: template: _default/list.html:4:4: executing "main" at <partial "edit-meta.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-meta.html:2:41": execute of template failed: template: partials/edit-meta.html:4:4: executing "partials/edit-meta.html" at <partial "edit-page.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-page.html:2:41": execute of template failed: template: partials/edit-page.html:2:41: executing "partials/edit-page.html" at <$.File.Path>: nil pointer evaluating source.File.Path
Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:4:4: executing "main" at <partial "edit-meta.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-meta.html:2:41": execute of template failed: template: partials/edit-meta.html:4:4: executing "partials/edit-meta.html" at <partial "edit-page.html" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-theme-techdoc/layouts/partials/edit-page.html:2:41": execute of template failed: template: partials/edit-page.html:2:41: executing "partials/edit-page.html" at <$.File.Path>: nil pointer evaluating source.File.Path
FAILED to create exampleSite for hugo-theme-techdoc
 ==== PROCESSING  hugo-book  ====== 
hugo-book is whitelisted
Building site for theme hugo-book using its own exampleSite to ../themeSite/static/theme/hugo-book/
WARN 2019/03/25 18:07:35 Page's .Dir is deprecated and will be removed in a future release. Use .File.Dir.
ERROR 2019/03/25 18:07:35 render of "section" failed: execute of template failed: template: docs/list.html:6:5: executing "docs/list.html" at <partial "docs/html-head" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-book/layouts/partials/docs/html-head.html:4:32": execute of template failed: template: partials/docs/shared.html:4:32: executing "title$htmltemplate_stateRCDATA_elementTitle" at <.Dir>: error calling Dir: runtime error: invalid memory address or nil pointer dereference
Error: Error building site: failed to render pages: render of "section" failed: execute of template failed: template: posts/list.html:6:5: executing "posts/list.html" at <partial "docs/html-head" .>: error calling partial: "/home/alex/work/src/hugoThemes/hugo-book/layouts/partials/docs/html-head.html:4:32": execute of template failed: template: partials/docs/shared.html:4:32: executing "title$htmltemplate_stateRCDATA_elementTitle" at <.Dir>: error calling Dir: runtime error: invalid memory address or nil pointer dereference
FAILED to create exampleSite for hugo-book


@adiabatic
Copy link
Contributor

I have

	<title>{{- .Site.Title -}}{{ with .Title }} — {{ . }}{{- end -}}</title>

in layouts/_default/baseof.html. layouts/index.html, layouts/_default/list.html, and layouts/_default/single.html all literally override nothing: their entire contents is {{ define "nothing" }}{{ end }}.

In the homebrew-provided 0.54.0 this outputs

    <title>Site Title</title>

for a homepage that has no title param in its page metadata (content/_index.md). This is behavior I like and have come to expect.

However, after I generated the same site with 0.55.0-DEV/extended, I got

    <title>Site Title — Site Title</title>

instead.

I'd be more than happy to make a minimized test case tomorrow (March 26 in the Americas) if that'll help.

@onedrawingperday
Copy link
Contributor

But the above is not readable in the template (at least I would have to scratch my head for a couple of minutes to figure it out).

Why haven't you instead opted for: {{ with .Params.Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }} or similar.

It works the same and it doesn't break with 0.55-DEV.

@adiabatic
Copy link
Contributor

It's plenty readable if you're the one who wrote it and have seen it work properly ;)

If I wrote it with a with-else block I'd have to write something like this (fair warning: I've never written a with-else block before):

{{ with .Params.Title }}{{ .Site.Title }} — {{ . }}
{{ else }}{{ .Site.Title }}{{ end }}

Writing it the way I did saves me from having to write out .Site.Title twice.

The docs so far have seemed to indicate that .Title and .Params.Title are interchangeable, so that's what I assumed when I wrote the line over a year ago. If .Title is meant to mean ".Params.Title if set, otherwise .Site.Title" in 0.55-DEV and going forward, then that's a change I wasn't expecting.

@onedrawingperday
Copy link
Contributor

If .Title is meant to mean ".Params.Title if set, otherwise .Site.Title" in 0.55-DEV and going forward, then that's a change I wasn't expecting.

No. The above is not entirely true. .Title can include .Site.Title it depends on the context.

To be honest I think that there was a flaw with that you were doing and I am a bit surprised it used to work.

But anyway this GitHub issue is most likely not the place to discuss templates’ logic.

Anyway you said what you used to do and what changed in 0.55-DEV If something needs to be reverted it’s not for me to say.

@bep
Copy link
Member Author

bep commented Mar 26, 2019

<title>{{- .Site.Title -}}{{ with .Title }} — {{ . }}{{- end -}}</title>

I have not looked at it, but I suspect that this is 1) The home page and 2) You have no content file (with a title) for that page? I guessing that the behavior for "title defaults" have somehow changed, which I will look into ...

@adiabatic
Copy link
Contributor

Yes, this is the home page. The associated content file, content/_index.md, has both YAML front matter and Markdown content, but, unlike every other page on the site, it has no title: in the front matter.

bep added a commit that referenced this issue Mar 26, 2019
@bep
Copy link
Member Author

bep commented Mar 26, 2019

@adiabatic I tried unsuccessfully to reproduce your issue in bceda1b -- so I suspect that there is something else going, of which I have no idea.

@adiabatic
Copy link
Contributor

On a separate site, I'm using this partial, called breadcrumb.html:


{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}

{{ define "breadcrumbnav" }}
    {{ if .p1.Parent }}
        {{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 )  }}
    {{ else if not .p1.IsHome }}
        {{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 )  }}
    {{ end }}

    {{ if not .p1.IsHome }}
        {{ if ne .p1 .p2 }}
            <h3><a href='{{ .p1.RelPermalink }}'>{{ .p1.Title }}</a></h3>
        {{ else }} 
            <h2>{{ .p1.Title }}{{ with .p1.Date }} ({{ . | dateFormat "2006" }}){{ end }}</h2>
        {{ end }}
    {{ end }}
{{ end }}

This partial is used on every page of a site. Some of these pages have date: and/or lastmod: params, while others don't.

Upgrading to 0.55 has gotten rid of a bunch of "(0001)"s generated by this (admittedly buggy) partial, which I like. However, it's also getting rid of all the perfectly valid dates as well:

> diff -r -U 1 public-54 public-55
diff -r -U 1 public-54/404/index.html public-55/404/index.html
--- public-54/404/index.html	2019-03-26 02:14:28.000000000 -0700
+++ public-55/404/index.html	2019-03-26 02:13:55.000000000 -0700
@@ -25,3 +25,3 @@
          
-            <h2>404 Not Found (0001)</h2>
+            <h2>404 Not Found</h2>
         
diff -r -U 1 public-54/archs/index.html public-55/archs/index.html
--- public-54/archs/index.html	2019-03-26 02:14:28.000000000 -0700
+++ public-55/archs/index.html	2019-03-26 02:13:55.000000000 -0700
@@ -25,3 +25,3 @@
          
-            <h2>Archs (0001)</h2>
+            <h2>Archs (2019)</h2>
         
diff -r -U 1 public-54/blog/index.html public-55/blog/index.html
--- public-54/blog/index.html	2019-03-26 02:14:28.000000000 -0700
+++ public-55/blog/index.html	2019-03-26 02:13:55.000000000 -0700
@@ -25,3 +25,3 @@
          
-            <h2>A blog (2019)</h2>
+            <h2>A blog</h2>
         
diff -r -U 1 public-54/categories/index.html public-55/categories/index.html
--- public-54/categories/index.html	2019-03-26 02:14:28.000000000 -0700
+++ public-55/categories/index.html	2019-03-26 02:13:55.000000000 -0700
@@ -25,3 +25,3 @@
          
-            <h2>Categories (0001)</h2>
+            <h2>Categories</h2>
         
diff -r -U 1 public-54/development-diaries/index.html public-55/development-diaries/index.html
--- public-54/development-diaries/index.html	2019-03-26 02:14:28.000000000 -0700
+++ public-55/development-diaries/index.html	2019-03-26 02:13:55.000000000 -0700
@@ -25,3 +25,3 @@
          
-            <h2>development diaries (2019)</h2>
+            <h2>development diaries</h2>
         
diff -r -U 1 public-54/nerd-words/index.html public-55/nerd-words/index.html
--- public-54/nerd-words/index.html	2019-03-26 02:14:28.000000000 -0700
+++ public-55/nerd-words/index.html	2019-03-26 02:13:55.000000000 -0700
@@ -25,3 +25,3 @@
          
-            <h2>Nerd Words (0001)</h2>
+            <h2>Nerd Words (2019)</h2>
         
diff -r -U 1 public-54/opinions/index.html public-55/opinions/index.html
--- public-54/opinions/index.html	2019-03-26 02:14:28.000000000 -0700
+++ public-55/opinions/index.html	2019-03-26 02:13:55.000000000 -0700
@@ -25,3 +25,3 @@
          
-            <h2>Opinions (2019)</h2>
+            <h2>Opinions</h2>
         
diff -r -U 1 public-54/sites/index.html public-55/sites/index.html
--- public-54/sites/index.html	2019-03-26 02:14:28.000000000 -0700
+++ public-55/sites/index.html	2019-03-26 02:13:55.000000000 -0700
@@ -25,3 +25,3 @@
          
-            <h2>Sites (0001)</h2>
+            <h2>Sites</h2>
         
diff -r -U 1 public-54/tags/index.html public-55/tags/index.html
--- public-54/tags/index.html	2019-03-26 02:14:28.000000000 -0700
+++ public-55/tags/index.html	2019-03-26 02:13:55.000000000 -0700
@@ -25,3 +25,3 @@
          
-            <h2>Tags (0001)</h2>
+            <h2>Tags</h2>

I'm not sure what the proper behavior should be, and I don't know if anyone's relying on current behavior, but this is a change.

@adiabatic
Copy link
Contributor

@adiabatic I tried unsuccessfully to reproduce your issue in bceda1b -- so I suspect that there is something else going, of which I have no idea.

Sounds like I should make a test case, then. On it.

@onedrawingperday
Copy link
Contributor

@bep
Commit 4dae52a fixed the above broken themes when I test them with the Themes Site Build Script. 👍

@adiabatic
Copy link
Contributor

Test case made for the .Title change. It's available at https://github.com/adiabatic/shenanigans-title. I'm using repeated runs of rm -r public-54 public-55 && /usr/local/bin/hugo && mv public public-54/ && ~/Projects/Go/bin/hugo && mv public public-55 && diff -ru public-54 public-55 to see what changes between 0.54 and 0.55. Hope this helps.

@bep
Copy link
Member Author

bep commented Mar 26, 2019

Please use the details tag for long listings ...

See https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d

Also, there are several date fixes in this release (and we have a billion test cases that passe), so what you see are most likely more correct -- but it would be great if you shouted if you are convinced they're not.

@bep
Copy link
Member Author

bep commented Mar 26, 2019

@adiabatic the "title issue" is fixed, I somehow forgot to add .Site.Title to my earlier test.

@adiabatic
Copy link
Contributor

I tried wrapping the listing in a <details> element and it didn't look right. This is because almost all Markdown processors stop Markdown processing inside explicitly-written HTML elements, and GitHub-Flavored Markdown is no exception, at least for <details>. I'd need to manually turn the code block into something with &lt;-escaped text to make it look right.

@bep
Copy link
Member Author

bep commented Mar 26, 2019

Even wrapped with a pre or something? It's not a big deal, it's just that threads like this gets very hard to follow after a while

@adiabatic
Copy link
Contributor

there are several date fixes in this release (and we have a billion test cases that passe), so what you see are most likely more correct -- but it would be great if you shouted if you are convinced they're not.

After sleeping on it, I'm convinced that the current behavior is incorrect.

In #5379, you wrote:

This means that you can now do:

{{ with .Date }}{{ . }}{{ end }}

And it would work as expected.

Given a template chunk like

<h2>{{ .p1.Title }}{{ with .p1.Date }} ({{ . | dateFormat "2006" }}){{ end }}</h2>

I'd expect output like

<h2>Opinions (2019)</h2>

for pages that have some sort of date associated with them (date, pubdate, lastmod, etc.) and

<h2>Tags</h2>

for pages that don't.

Current (in 0.55-DEV, as of five minutes ago) behavior around .Date is inexplicable — that is, I can't imagine how to explain current behavior. Here's the diff output of my other site:

> diff -r -U 0  public-54 public-55
diff -r -U 0 public-54/404/index.html public-55/404/index.html
--- public-54/404/index.html	2019-03-26 10:59:17.000000000 -0700
+++ public-55/404/index.html	2019-03-26 10:59:17.000000000 -0700
@@ -26 +26 @@
-            <h2>404 Not Found (0001)</h2>
+            <h2>404 Not Found</h2>
diff -r -U 0 public-54/archs/index.html public-55/archs/index.html
--- public-54/archs/index.html	2019-03-26 10:59:17.000000000 -0700
+++ public-55/archs/index.html	2019-03-26 10:59:17.000000000 -0700
@@ -26 +26 @@
-            <h2>Archs (0001)</h2>
+            <h2>Archs (2019)</h2>
diff -r -U 0 public-54/blog/index.html public-55/blog/index.html
--- public-54/blog/index.html	2019-03-26 10:59:17.000000000 -0700
+++ public-55/blog/index.html	2019-03-26 10:59:17.000000000 -0700
@@ -26 +26 @@
-            <h2>A blog (2019)</h2>
+            <h2>A blog</h2>
diff -r -U 0 public-54/categories/index.html public-55/categories/index.html
--- public-54/categories/index.html	2019-03-26 10:59:17.000000000 -0700
+++ public-55/categories/index.html	2019-03-26 10:59:17.000000000 -0700
@@ -26 +26 @@
-            <h2>Categories (0001)</h2>
+            <h2>Categories</h2>
diff -r -U 0 public-54/development-diaries/index.html public-55/development-diaries/index.html
--- public-54/development-diaries/index.html	2019-03-26 10:59:17.000000000 -0700
+++ public-55/development-diaries/index.html	2019-03-26 10:59:17.000000000 -0700
@@ -26 +26 @@
-            <h2>development diaries (2019)</h2>
+            <h2>development diaries</h2>
diff -r -U 0 public-54/nerd-words/index.html public-55/nerd-words/index.html
--- public-54/nerd-words/index.html	2019-03-26 10:59:17.000000000 -0700
+++ public-55/nerd-words/index.html	2019-03-26 10:59:17.000000000 -0700
@@ -26 +26 @@
-            <h2>Nerd Words (0001)</h2>
+            <h2>Nerd Words (2019)</h2>
diff -r -U 0 public-54/opinions/index.html public-55/opinions/index.html
--- public-54/opinions/index.html	2019-03-26 10:59:17.000000000 -0700
+++ public-55/opinions/index.html	2019-03-26 10:59:17.000000000 -0700
@@ -26 +26 @@
-            <h2>Opinions (2019)</h2>
+            <h2>Opinions</h2>
diff -r -U 0 public-54/sites/index.html public-55/sites/index.html
--- public-54/sites/index.html	2019-03-26 10:59:17.000000000 -0700
+++ public-55/sites/index.html	2019-03-26 10:59:17.000000000 -0700
@@ -26 +26 @@
-            <h2>Sites (0001)</h2>
+            <h2>Sites</h2>
diff -r -U 0 public-54/tags/index.html public-55/tags/index.html
--- public-54/tags/index.html	2019-03-26 10:59:17.000000000 -0700
+++ public-55/tags/index.html	2019-03-26 10:59:17.000000000 -0700
@@ -26 +26 @@
-            <h2>Tags (0001)</h2>
+            <h2>Tags</h2>

For what it's worth, tags, categories, sites, archs, and nerd words are all taxonomies.

Let me review the changes as best as I am able:

  • Category pages (/opinions/, /blog/, /development-diaries/) used to take a date from their subpages. Now they don't. I like this change, but I can see why someone would like the old behavior.

  • The 404 page doesn't have a truthy-but-useless date anymore. I like this change.

  • Taxonomy pages that have at least one page in that taxonomy (/archs/, /nerd-words/) go from a truthy-but-useless date (0001) to a reasonable date (2019). This is because there is one document with an arch declared (archs: freebsd), a bunch of nerd words declared, and the page has a date declared with date: &d 2019-03-22. This is an improvement over 0.54, but it's inconsistent with what category pages do. As a user who doesn't read the docs closely every single time, I'd be surprised by this difference between category pages and taxonomy pages.

  • Taxonomy pages that have no pages in that taxonomy (/categories/, /sites/, /tags/) go from a truthy-but-useless date to no date. Like all removals of truthy-but-usless dates, this is an improvement.


I think both category pages and taxonomy pages should have the "dates are inherited from subpages" property or neither should. I weakly favor the "neither should" option. If a template writer wants dates, he shouldn't try to depend on a single "date" function/value with no defined meaning. He should use things like .MostRecentDate, .LeastRecentDate, .MostRecentLastmod, .LeastRecentLastmod, .MostRecentCreated, .LeastRecentCreated, and so on. These things would be defined for categories and taxonomies. This way, he'll be using an interface that has obvious semantics. If our template author comes to assume that .Date on a taxonomy page always returns the most recent date, he might get a nasty surprise if that property accidentally changes in some later release.

@adiabatic
Copy link
Contributor

Yes, even wrapped with a <pre>. <pre> won't automatically turn < into &lt;, and I need that functionality to make HTML snippets look right.

@bep
Copy link
Member Author

bep commented Apr 5, 2019

The ERROR in B: Is that new? As in: Does it run fine in 0.54?

@divinerites
Copy link

divinerites commented Apr 5, 2019

Yes. I only report the differences between 0.54 and 0.55DEV

$ /Users/didiergeorgieff/go/bin/hugo server --gc --verbose with hugo 0.55DEV

port 1313 already in use, attempting to use an available port INFO 2019/04/05 16:04:50 Using config file: Building sites … INFO 2019/04/05 16:04:50 syncing static files to / INFO 2019/04/05 16:04:50 found taxonomies: map[string]string{"category":"categories", "tag":"tags"} INFO 2019/04/05 16:04:50 found taxonomies: map[string]string{"category":"categories", "tag":"tags"} WARN 2019/04/05 16:04:50 Page's .Hugo is deprecated and will be removed in a future release. Use the global hugo function.
               | FR  | EN   

+------------------+-----+-----+
Pages | 25 | 25
Paginator pages | 0 | 0
Non-page files | 0 | 0
Static files | 147 | 147
Processed images | 95 | 1
Aliases | 2 | 1
Sitemaps | 2 | 1
Cleaned | 0 | 0

Total in 646 ms
Watching for changes in /Users/didiergeorgieff/Documents/Git/lagouille.com/{assets,content,data,i18n,layouts,static,themes}
WARN 2019/04/05 16:04:50 Unable to increase number of open files limit invalid argument
Watching for config changes in /Users/didiergeorgieff/Documents/Git/lagouille.com/config.toml
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:61947/ (bind address 127.0.0.1)
Press Ctrl+C to stop
ERROR 2019/04/05 16:04:50 Error: listen tcp 127.0.0.1:61947: socket: too many open files

$ hugo server --gc --verbose with hugo 0.54

port 1313 already in use, attempting to use an available port INFO 2019/04/05 16:05:42 Using config file: Building sites … INFO 2019/04/05 16:05:42 syncing static files to / INFO 2019/04/05 16:05:42 found taxonomies: map[string]string{"tag":"tags", "category":"categories"} INFO 2019/04/05 16:05:42 found taxonomies: map[string]string{"tag":"tags", "category":"categories"} INFO 2019/04/05 16:05:42 Alias "blog/une-nouvelle-equipe/" translated to "blog/une-nouvelle-equipe/index.html" INFO 2019/04/05 16:05:42 Alias "fr" translated to "fr/index.html" INFO 2019/04/05 16:05:43 Alias "en/a-new-team" translated to "en/a-new-team/index.html" INFO 2019/04/05 16:05:43 Alias "fr" translated to "fr/index.html"
               | FR  | EN   

+------------------+-----+-----+
Pages | 25 | 25
Paginator pages | 0 | 0
Non-page files | 0 | 0
Static files | 147 | 147
Processed images | 91 | 1
Aliases | 2 | 2
Sitemaps | 2 | 1
Cleaned | 0 | 0

Total in 227 ms
Watching for changes in /Users/didiergeorgieff/Documents/Git/lagouille.com/{assets,content,data,i18n,layouts,static,themes}
Watching for config changes in /Users/didiergeorgieff/Documents/Git/lagouille.com/config.toml
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:61973/ (bind address 127.0.0.1)
Press Ctrl+C to stop

@divinerites
Copy link

May be not related but on the 3 sites with "WARN 2019/04/05 14:10:27 Unable to increase number of open files limit invalid argument", the 2 failing are multilingual, and the one going live in server mode is without multilanguage.

@divinerites
Copy link

Those 3 sites are on GitHub and I can give you access if needed.

@bep
Copy link
Member Author

bep commented Apr 5, 2019

A: These warnings are deliberate.
C: Fixed in 75467cd (good catch)

B: Is the only one I don't understand, so I assume an upstream change ... somewhere ... It would be great if you could share that repo with me. 2 questions:

  • What OS do you build with?
  • I assume the Hugo 0.54 (working) is a release binary compiled with Go 1.11? And that you built 0.55 with Go 1.12.1?

nguyenvanduocit pushed a commit to 12bitvn/hugo that referenced this issue Apr 5, 2019
It was removed in 597e418 -- it's not documented, but it's used in too many real sites on the web.

See gohugoio#5784
nguyenvanduocit pushed a commit to 12bitvn/hugo that referenced this issue Apr 5, 2019
nguyenvanduocit pushed a commit to 12bitvn/hugo that referenced this issue Apr 5, 2019
nguyenvanduocit pushed a commit to 12bitvn/hugo that referenced this issue Apr 5, 2019
Note that this fixes some "live reload" issues recently introduced in non-released code.

Closes gohugoio#5811
See gohugoio#5784
nguyenvanduocit pushed a commit to 12bitvn/hugo that referenced this issue Apr 5, 2019
@divinerites
Copy link

divinerites commented Apr 5, 2019

  • You're invited Bep on one of the 3 repos.
  • A : yes i was guessing but prefered to report it anyway.
  • Mac OS Mojave 10.14.4
  • Yes official hugo 0.54 installed thru brew
  • Local 0.55DEV build from source after updating to go1.12.1 darwin/amd64
  • C : my pleasure :-)

@bep
Copy link
Member Author

bep commented Apr 5, 2019

@divinerites just to make sure: The site you shared with me was the site you got " too many open files
"? It works fine for me, and I assume that's because I set the ulimit manually at some time ...

@divinerites
Copy link

divinerites commented Apr 5, 2019

Yes bep. This site fails (divinerites/lagouille.com).

$ ulimit 
unlimited
$ launchctl limit maxfiles
maxfiles    256            unlimited      

@adiabatic
Copy link
Contributor

adiabatic commented Apr 5, 2019

Chiming in to say I've gotten this warning starting in 0.55-DEV; I just haven't mentioned it because I was busy pinning down other changes ;)

  • WARN 2019/04/05 14:10:27 Unable to increase number of open files limit invalid argument

I've gotten this warning (I've been building on macOS Mojave 10.14.4 with go 1.12.1), but not the error. My "normal" hugo is the one provided by homebrew. I suspect my sites are smaller than most, though.

For example, I get it in https://github.com/bep/hugo-dates:

 ~/Downloads/hugo-dates-master > hugo serve
               | EN  

+------------------+----+
Pages | 23
Paginator pages | 0
Non-page files | 0
Static files | 0
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0

Total in 6 ms
Watching for changes in ~/Downloads/hugo-dates-master/{content,layouts}
WARN 2019/04/05 09:17:52 Unable to increase number of open files limit invalid argument
Watching for config changes in ~/Downloads/hugo-dates-master/config.toml
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/ (bind address 127.0.0.1)
Press Ctrl+C to stop

The output of ulimit and launchctl limit maxfiles on my machine matches divinerites'.

bep added a commit to bep/hugo that referenced this issue Apr 5, 2019
@bep
Copy link
Member Author

bep commented Apr 5, 2019

I assume it is this massive commit in Go 1.12.1:

golang/go@a3b0144#diff-a7c1e05474b922ebf6f2905fc1e88c64

It does not fail for me though (macOS Mojave 10.14.4 with go 1.12.1) ... Will think about it.

Could one of you try to build this branch and see if the problem goes away:

https://github.com/bep/hugo/tree/ulimit

That branch uses golang/sys to do the ulimit changes.

@divinerites
Copy link

Will try (I'm a noob in Go/compilation tho)...

@adiabatic
Copy link
Contributor

adiabatic commented Apr 5, 2019

No obvious change.

~/Downloads/hugo-dates > hugo serve
               | EN  

+------------------+----+
Pages | 25
Paginator pages | 0
Non-page files | 0
Static files | 0
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0

Total in 7 ms
Watching for changes in ~/Downloads/hugo-dates/{content,layouts}
WARN 2019/04/05 13:45:27 Unable to increase number of open files limit invalid argument
Watching for config changes in ~/Downloads/hugo-dates/config.toml
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/ (bind address 127.0.0.1)
Press Ctrl+C to stop

@bep
Copy link
Member Author

bep commented Apr 5, 2019

@adiabatic curious, but thanks. I will investigate, and @divinerites you can call if your "compile the branch" struggles if you want ...

@bep
Copy link
Member Author

bep commented Apr 6, 2019

Seems to be related to this issue: golang/go#30401

@bep
Copy link
Member Author

bep commented Apr 6, 2019

OK, I can reproduce this myself by editing lowering the limit in /Library/LaunchDaemons/limit.maxfiles.plist and restart my computer.

I will adjust the logic so the WARNING goes away and add some documentation somewhere (with a link in the error log if possible) with info about how to work around the "too many open files" if it still is too low (which in short is to edit /Library/LaunchDaemons/limit.maxfiles.plist and restart).

@divinerites
Copy link

divinerites commented Apr 6, 2019

C: Fixed in 75467cd (good catch)

I confirm this error is gone with the latest DEV (compiled with latest go1.12.2). Thanks Bep.

@divinerites
Copy link

I will adjust the logic so the WARNING goes away and add some documentation somewhere (with a link in the error log if possible) with info about how to work around the "too many open files" if it still is too low (which in short is to edit /Library/LaunchDaemons/limit.maxfiles.plist and restart).

  • I rebuild latest gohugo with your commit #708d4cee.
  • No more warning.
  • No more error and I didn't need to change anything. Seems like working fine !! Thanks a lot Bep.

@bep
Copy link
Member Author

bep commented Apr 8, 2019

@divinerites I'm about to release this now, so any issue related to that release will need to be handled in separate issues.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants