Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Themes broken in Hugo 0.65.2 #810

Closed
onedrawingperday opened this issue Feb 21, 2020 · 15 comments
Closed

Themes broken in Hugo 0.65.2 #810

onedrawingperday opened this issue Feb 21, 2020 · 15 comments
Labels

Comments

@onedrawingperday
Copy link
Contributor

5 themes in the repo are broken due to the updates in Hugo 0.65.x

The following 3 seem to be affected by gohugoio/hugo#6931

8:04:57 PM:  ==== PROCESSING  hugo-theme-zzo  ======
8:04:58 PM: hugo-theme-zzo is whitelisted
8:04:58 PM: Building site for theme hugo-theme-zzo using its own exampleSite to ../themeSite/static/theme/hugo-theme-zzo/
8:04:58 PM: Error: Error building site: render of "404" failed: execute of template failed: template: 404.html:32:15: executing "404.html" at <partial "footer/site-footer" .>: error calling partial: execute of template failed: template: partials/footer/site-footer.html:3:7: executing "partials/footer/site-footer.html" at <partial "footer/links-social.html" .>: error calling partial: execute of template failed: template: partials/footer/links-social.html:11:7: executing "partials/footer/links-social.html" at <partial "footer/links-feed.html" .>: error calling partial: "/opt/build/repo/hugo-theme-zzo/layouts/partials/footer/links-feed.html:5:31": execute of template failed: template: partials/footer/links-feed.html:5:31: executing "partials/footer/links-feed.html" at <.FirstSection.Permalink>: error calling FirstSection: runtime error: invalid memory address or nil pointer dereference
8:04:58 PM: FAILED to create exampleSite for hugo-theme-zzo


8:05:35 PM:  ==== PROCESSING  new-oldnew-mashup  ======
8:05:35 PM: Updating git submodules for theme new-oldnew-mashup
8:05:35 PM: Building site for theme new-oldnew-mashup using default content to ../themeSite/static/theme/new-oldnew-mashup/
8:05:38 PM: Error: Error building site: render of "404" failed: execute of template failed: template: 404.html:23:9: executing "navigation" at <partial "navigation/local-nav/bar" .Page>: error calling partial: execute of template failed: template: partials/navigation/local-nav/bar.html:1:112: executing "partials/navigation/local-nav/bar.html" at <partial "navigation/local-nav/generate/prevrecurse" (dict "cur_node" . "menu_node" .)>: error calling partial: "/opt/build/repo/new-oldnew-mashup/layouts/partials/navigation/local-nav/generate/prevrecurse.html:21:41": execute of template failed: template: partials/navigation/local-nav/generate/prevrecurse.html:21:41: executing "partials/navigation/local-nav/generate/prevrecurse.html" at <$curNode.IsAncestor>: error calling IsAncestor: runtime error: invalid memory address or nil pointer dereference
8:05:38 PM: FAILED to create exampleSite for new-oldnew-mashup


8:05:47 PM:  ==== PROCESSING  hugo-theme-techdoc  ======
8:05:47 PM: hugo-theme-techdoc is whitelisted
8:05:47 PM: Building site for theme hugo-theme-techdoc using its own exampleSite to ../themeSite/static/theme/hugo-theme-techdoc/
8:05:47 PM: Error: Error building site: render of "404" failed: execute of template failed: template: 404.html:22:4: executing "404.html" at <partial "sidebar.html" .>: error calling partial: execute of template failed: template: partials/sidebar.html:3:4: executing "partials/sidebar.html" at <partial "menu/open-menu.html" .>: error calling partial: "/opt/build/repo/hugo-theme-techdoc/layouts/partials/menu/open-menu.html:25:17": execute of template failed: template: partials/menu/open-menu.html:25:17: executing "open-menu" at <.IsAncestor>: error calling IsAncestor: runtime error: invalid memory address or nil pointer dereference
8:05:47 PM: FAILED to create exampleSite for hugo-theme-techdoc

While these 2 contain ambiguous page references. These errors are also new.

8:06:06 PM:  ==== PROCESSING  hugo-owaraiclub  ======
8:06:06 PM: hugo-owaraiclub is whitelisted
8:06:06 PM: Building site for theme hugo-owaraiclub using its own exampleSite to ../themeSite/static/theme/hugo-owaraiclub/
8:06:06 PM: Error: Error building site: failed to render pages: render of "taxonomy" failed: execute of template failed: template: _default/list.html:15:15: executing "main" at <partial "wiki_summary.html" .>: error calling partial: "/opt/build/repo/hugo-owaraiclub/layouts/partials/wiki_summary.html:2:14": execute of template failed: template: partials/wiki_summary.html:2:14: executing "partials/wiki_summary.html" at <.Site.GetPage>: error calling GetPage: page reference "/themes" is ambiguous
8:06:06 PM: FAILED to create exampleSite for hugo-owaraiclub


8:06:08 PM:  ==== PROCESSING  syna  ======
8:06:08 PM: syna is whitelisted
8:06:08 PM: Building site for theme syna using its own exampleSite to ../themeSite/static/theme/syna/
8:06:08 PM: Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:10:7: executing "_default/single.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "/opt/build/repo/syna/layouts/partials/fragments/nav.html:142:40": execute of template failed: template: partials/fragments/nav.html:142:40: executing "partials/fragments/nav.html" at <$.root.Site.GetPage>: error calling GetPage: page reference "//fragments" is ambiguous
8:06:08 PM: FAILED to create exampleSite for syna

@digitalcraftsman
Copy link
Member

@onedrawingperday do you suggest a rollback for now?

@onedrawingperday
Copy link
Contributor Author

onedrawingperday commented Feb 21, 2020

It's not that many themes, so no, I do not suggest a rollback.

It seems that 3 will be fixed when gohugoio/hugo#6931 is addressed

As for the other 2 that throw the ambiguous page reference error I am investigating.

Also maybe @bep knows what changed in the .GetPage method.

@digitalcraftsman
Copy link
Member

The advantage is that we've a wide range of themes that can be tested against the new Hugo version (even though the bugs seem to have been reported from other sources already).

@onedrawingperday
Copy link
Contributor Author

@bep

I confirm that commit gohugoio/hugo@a524124 fixed hugo-theme-zzo, new-oldnew-mashup and hugo-theme-techdoc

The remaining 2 broken themes appear to be affected by what is described in this forum topic

I have asked the author of the forum topic to open a relevant GitHub issue to track the error about the ambiguous page references.

@bep
Copy link
Member

bep commented Feb 22, 2020

@onedrawingperday thanks. I checked one of the "ambigous" errors, and I think this comes from a improved re-implementation of GetPage.

Here is the template used:

<div class ="wiki-container">
 {{ with .Site.GetPage .Title }}
    {{ if gt (len .Content ) 0}} 
       <a href="{{ .Permalink }}"><h1>Wiki</h1></a>
       {{ .Summary }}
    {{ end}}
 {{ end }}
</div>

The above does make much sense to me, but using Title as the key gets you into trouble.

In .Site.GetPage we fall back to a potentially ambiguous lookup using the base name only.

In the above failing case, the normalized title is themes -- and the site have both tags/themes and categories/themes ... and hence it is impossible to decide which.

I suspect that theme construct should be rewritten totally, but this would work:

<div class ="wiki-container">
 {{ with .Site.GetPage .Path }}
    {{ if gt (len .Content ) 0}} 
       <a href="{{ .Permalink }}"><h1>Wiki</h1></a>
       {{ .Summary }}
    {{ end}}
 {{ end }}
</div>

@jgreely
Copy link

jgreely commented Feb 22, 2020

I have asked the author of the forum topic to open a relevant GitHub issue to track the error about the ambiguous page references.

I'm not getting ambiguous page references; the site builds without warnings, it just fails to find any pages that are in sub-directories. I'll knock together a minimal site showing that problem, but you'll have to find someone else to file a bug on the other problem.

@onedrawingperday
Copy link
Contributor Author

onedrawingperday commented Feb 22, 2020

@bep I see. I will try to notify the theme authors about the need to rewrite their code.

@jgreely Well, thank you for the clarification. When you have the minimal site ready please share it in the respective forum topic.

@bep
Copy link
Member

bep commented Feb 22, 2020

@onedrawingperday I have the themes built with Hugo master here: https://app.netlify.com/sites/hugothemes/deploys/5e5151c51a39ee000a2012c2

It's rather hardcoded at the moment...

@jgreely
Copy link

jgreely commented Feb 23, 2020

@onedrawingperday I've updated the forum topic with a link to the repeat-by repo.

@bep
Copy link
Member

bep commented Feb 23, 2020

@jgreely see my comment in the forum about your case.

@onedrawingperday
Copy link
Contributor Author

onedrawingperday commented Feb 23, 2020

@bep Actually the second theme Syna provides its own custom-made "content fragments" that rely on some pretty complex GetPage methods (and the previous link is just one example).

Obviously there is no time to debug such a complex theme.

Also I honestly think that we need to draw up some limits about the kind of themes we accept in this repo.

For example the above theme basically overrides Hugo's default content management.

Of course with Hugo functions one can do pretty much anything.
But at the same I am not sure whether this repo is the proper place for such complexity.

cc: @digitalcraftsman

@bep
Copy link
Member

bep commented Feb 23, 2020

@onedrawingperday I certainly don't have time/interest in debugging that template code.

@onedrawingperday
Copy link
Contributor Author

onedrawingperday commented Feb 23, 2020

@bep I didn't ask you to debug that theme.

I only asked whether we should host this type of complex themes in this repo.

Basically themes that provide their own setup that more or less overrides the default way of doing things.

I think that we need to discuss this. So if you agree I will open a new issue so that we can talk about it before putting it in writing in the README.

Actually no. I changed my mind.

Basically the 30 day rule will apply. If the theme authors do not fix the demos then next month these will be removed from the repo.

That's just how it's going to be I am afraid.

@stale
Copy link

stale bot commented Mar 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. Feel free to ask questions. We're glad to help.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Mar 14, 2020
@onedrawingperday
Copy link
Contributor Author

Only hugo-owaraiclub remains broken. If it is not fixed by the end of the month it will be removed.

So I am closing this issue since it is mostly resolved.

onedrawingperday added a commit that referenced this issue Mar 21, 2020
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