Schnouki / hugo-baguetteBox

A Hugo theme component that provides an image gallery and lightbox powered by baguetteBox.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in Hugo v0.55.6

sardaukar opened this issue · comments

I've enable this on config.toml after cloning it to themes and I get this when I try to use a gallery:

Total in 56 ms
Error: Error building site: "/home/sardaukar/Code/OWN/hugo/blogV2/content/post/amiga-bbs-online-2019.md:7:1": failed to render shortcode "gallery": failed to process shortcode: "/home/sardaukar/Code/OWN/hugo/blogV2/themes/hugo-baguetteBox/layouts/shortcodes/galimg.html:8:36": execute of template failed: template: shortcodes/galimg.html:8:36: executing "shortcodes/galimg.html" at <$img.Fill>: nil pointer evaluating resource.Resource.Fill

Hi @sardaukar,

Thanks for getting in touch, and sorry about this... There are actually 2 problems here: poor error reporting from Hugo, and poor documentation from my part.

The error you've pasted here is basically Hugo complaining that it could not find an image.

hugo-baguetteBox relies on Hugo's image processing to automatically generate thumbnails. But this also requires your content to be organized in page bundles. Which basically means that instead of having your post in content/post/amiga-bbs-online-2019.md and images anywhere , you should have your post as content/post/amiga-bbs-online-2019/index.md with the images in the same folder. Then you can use {{% galimg target="image-name.jpg" %}}.

I'm working on improving this in several ways:

  • add an explicit error message
  • make galimg easier to use when there's just a target without any other parameter
  • add a full documentation with more examples

I hope I'll be able to push that in a few days.

Thanks again and I hope this helps! (And nice article BTW. I still have my old Amiga 500 at my parents' house but I've only ever used it for games when I was a kid 😅)

I managed to tweak some code I found on dev.to to work with my setup so no rush to fix it ;)