balaramadurai / hugo-travelify-theme

Port of Aigars Silkalns's Wordpress theme Travelify to Hugo. Demo -
http://balaramadurai.github.io
MIT License
39 stars 27 forks source link

hugo building sites error #24

Closed changchichung closed 6 years ago

changchichung commented 6 years ago

copy config.toml data/l10n.toml from exampleSite to hugo root folder , but get these error when try to generate

chchang@hexo:~/hugo/hugo_netlify$ hugo 
Building sites … ERROR 2018/10/30 16:43:01 Error while rendering "page" in "post/": template: theme/_default/single.html:12:10: executing "theme/_default/single.html" at <partial "single_arti...>: error calling partial: template: theme/partials/single_article.html:12:9: executing "theme/partials/single_article.html" at <partial "article_foo...>: error calling partial: template: theme/partials/article_footer.html:27:32: executing "theme/partials/article_footer.html" at <.Params.categories>: range can't iterate over 雜念
balaramadurai commented 6 years ago

Hello @changchichung Thank you for raising an issue for the theme.

I tried recreating the error, but could not. It works fine with my setup.

What version of hugo do you use? Did you copy all the files from exampleSite?

Do you mind sharing your config file for me to take a look at? Did you change anything in the I10n.toml file?

Thanks and have a great day! Bala

changchichung commented 6 years ago

here are my steps , I try to create a new site , git clone themes , and generate static file

chchang@hexo:~/hugo$ hugo new site travelify
Congratulations! Your new Hugo site is created in /home/chchang/hugo/travelify.

Just a few more steps and you're ready to go:

1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/, or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".

Visit https://gohugo.io/ for quickstart guide and full documentation.
chchang@hexo:~/hugo$ cd travelify/
chchang@hexo:~/hugo/travelify$ ls
archetypes  config.toml  content  data  layouts  static  themes
chchang@hexo:~/hugo/travelify$ cd themes
chchang@hexo:~/hugo/travelify/themes$ ls
chchang@hexo:~/hugo/travelify/themes$ git clone https://github.com/balaramadurai/hugo-travelify-theme.git
Cloning into 'hugo-travelify-theme'...
remote: Enumerating objects: 31, done.
remote: Counting objects: 100% (31/31), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 611 (delta 14), reused 18 (delta 7), pack-reused 580
Receiving objects: 100% (611/611), 8.27 MiB | 3.41 MiB/s, done.
Resolving deltas: 100% (331/331), done.

cp files , but I did not change any settings , not yet

chchang@hexo:~/hugo/travelify$ cp themes/hugo-travelify-theme/exampleSite/config.toml ./
chchang@hexo:~/hugo/travelify$ cp themes/hugo-travelify-theme/exampleSite/data/l10n.toml ./

then try to start server

chchang@hexo:~/hugo/travelify$ hugo server -D
Building sites … ERROR 2018/11/01 04:03:45 "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/_default/terms.html:3:19": execute of template failed: template: _default/terms.html:25:4: executing "_default/terms.html" at <partial "widgets" .>: error calling partial: "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/partials/widgets.html:3:19": execute of template failed: template: partials/widgets.html:9:7: executing "partials/widgets.html" at <partial "widgets/tag...>: error calling partial: "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/partials/widgets/tag_cloud.html:3:19": execute of template failed: template: partials/widgets/tag_cloud.html:3:19: executing "partials/widgets/tag_cloud.html" at <mul ($min_count) 2>: error calling mul: Can't apply the operator to the values
ERROR 2018/11/01 04:03:45 "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/_default/terms.html:3:19": execute of template failed: template: _default/terms.html:25:4: executing "_default/terms.html" at <partial "widgets" .>: error calling partial: "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/partials/widgets.html:3:19": execute of template failed: template: partials/widgets.html:9:7: executing "partials/widgets.html" at <partial "widgets/tag...>: error calling partial: "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/partials/widgets/tag_cloud.html:3:19": execute of template failed: template: partials/widgets/tag_cloud.html:3:19: executing "partials/widgets/tag_cloud.html" at <mul ($min_count) 2>: error calling mul: Can't apply the operator to the values
ERROR 2018/11/01 04:03:45 "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/index.html:3:19": execute of template failed: template: index.html:19:4: executing "index.html" at <partial "widgets" .>: error calling partial: "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/partials/widgets.html:3:19": execute of template failed: template: partials/widgets.html:9:7: executing "partials/widgets.html" at <partial "widgets/tag...>: error calling partial: "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/partials/widgets/tag_cloud.html:3:19": execute of template failed: template: partials/widgets/tag_cloud.html:3:19: executing "partials/widgets/tag_cloud.html" at <mul ($min_count) 2>: error calling mul: Can't apply the operator to the values
Total in 24 ms
Error: Error building site: failed to render pages: "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/_default/terms.html:3:19": execute of template failed: template: _default/terms.html:25:4: executing "_default/terms.html" at <partial "widgets" .>: error calling partial: "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/partials/widgets.html:3:19": execute of template failed: template: partials/widgets.html:9:7: executing "partials/widgets.html" at <partial "widgets/tag...>: error calling partial: "/home/chchang/hugo/travelify/themes/hugo-travelify-theme/layouts/partials/widgets/tag_cloud.html:3:19": execute of template failed: template: partials/widgets/tag_cloud.html:3:19: executing "partials/widgets/tag_cloud.html" at <mul ($min_count) 2>: error calling mul: Can't apply the operator to the values
chchang@hexo:~/hugo/travelify$ 

both config.toml / l10n.toml were not touched after cp from examplesites to hugo root directory

balaramadurai commented 6 years ago

@changchichung, Thank you for your detailed steps on how to recreate the error. I could find out the error and fix it.

I would like to suggest that you copy all the contents from exampleSite folder on to your hugo folder for the theme to work well.

cp -r themes/hugo-travelify-theme/exampleSite/* .

Thanks for using the theme! Have fun and enjoy your day! Bala