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

Theme demo is broken on the Hugo Themes Site #37

Closed
onedrawingperday opened this issue Dec 1, 2019 · 8 comments
Closed

Theme demo is broken on the Hugo Themes Site #37

onedrawingperday opened this issue Dec 1, 2019 · 8 comments

Comments

@onedrawingperday
Copy link

@onedrawingperday onedrawingperday commented Dec 1, 2019

Hello @carsonip

It seems that commit 95686c0 broke your theme:

9:53:44 AM:  ==== PROCESSING  hugo-theme-minos  ======
9:53:45 AM: Building site for theme hugo-theme-minos using config "/opt/build/repo/_script/hugoThemeSite/config-hugo-theme-minos.toml" to ../themeSite/static/theme/hugo-theme-minos/
9:53:45 AM: Error: Error building site: failed to render pages: render of "taxonomy" failed: "/opt/build/repo/hugo-theme-minos/layouts/taxonomy/tag.html:7:60": execute of template failed: template: taxonomy/tag.html:1:3: executing "taxonomy/tag.html" at <partial "head.html" .>: error calling partial: "/opt/build/repo/hugo-theme-minos/layouts/partials/head.html:7:60": execute of template failed: template: partials/head.html:6:7: executing "partials/head.html" at <partial "meta.html" .>: error calling partial: "/opt/build/repo/hugo-theme-minos/layouts/partials/meta.html:7:60": execute of template failed: template: partials/meta.html:7:60: executing "partials/meta.html" at <$author>: range can't iterate over Hugo
9:53:45 AM: FAILED to create demo site for hugo-theme-minos

Please look at it and let me know.

Thanks

@carsonip

This comment has been minimized.

Copy link
Owner

@carsonip carsonip commented Dec 1, 2019

Cannot reproduce the issue. I am using https://github.com/gohugoio/HugoBasicExample and hugo version Hugo Static Site Generator v0.54.0-B1A82C61 linux/amd64 BuildDate: 2019-02-01T09:40:34Z I also tried v0.60.1, no issue.

May I know your Hugo version and the test site you are using?

@onedrawingperday

This comment has been minimized.

Copy link
Author

@onedrawingperday onedrawingperday commented Dec 1, 2019

I am one of the maintainers of https://themes.gohugo.io/ and the above quote is from the latest deploy log of the Hugo Themes website on Netlify.

The website uses the latest Hugo i.e. v.0.60.1

@carsonip

This comment has been minimized.

Copy link
Owner

@carsonip carsonip commented Dec 1, 2019

I acknowledge that you are a maintainer and thanks for maintaining the themes site. I thought hugo themes site uses https://github.com/gohugoio/HugoBasicExample but I didn't find any errors with it and 0.60.1 locally.

@carsonip

This comment has been minimized.

Copy link
Owner

@carsonip carsonip commented Dec 1, 2019

Although I cannot reproduce it locally, I am looking into the issue right now, please give me some time.

@onedrawingperday

This comment has been minimized.

Copy link
Author

@onedrawingperday onedrawingperday commented Dec 1, 2019

You have plenty of time.

Also have a look at the instructions for testing the theme site locally: https://github.com/gohugoio/hugoThemes#testing-a-theme-with-the-hugo-themes-website-build-script

@onedrawingperday

This comment has been minimized.

Copy link
Author

@onedrawingperday onedrawingperday commented Dec 1, 2019

If line 7 of partials/meta.html is changed to:
{{ if $author -}} <meta name="author" content="{{ $author }}"> {{- end }

Then the theme demo will generate with the Hugo Themes build script.

You do not provide any sample config in your theme.
The inherited author parameter from the Hugo Basic Example is a string
You cannot use the range function over a string.
Hence the ERROR.

@carsonip

This comment has been minimized.

Copy link
Owner

@carsonip carsonip commented Dec 1, 2019

I am looking at the same line. However .Site.Params.Author should be empty since the author variable in basic example is mapped to .Site.Author. Somehow in theme example site generation the config .Site.Params.Author is non-empty and is a string.

Anyway, I am looking at doing:

    {{ with .Site.Params.Author -}}<meta name="author" content="{{ . }}">{{- end }}

Just ignore .Site.Author and use Params instead.

@carsonip carsonip closed this in b210577 Dec 1, 2019
@onedrawingperday

This comment has been minimized.

Copy link
Author

@onedrawingperday onedrawingperday commented Dec 1, 2019

@carsonip

I have updated your theme and its demo is now published again on the Hugo Themes website:
https://themes.gohugo.io/hugo-theme-minos/

Thank you for issuing a fix so quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.