HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.36k stars 2.9k forks source link

Unable to load gallery when a album directory contains capital letter #2887

Closed old6ix closed 1 year ago

old6ix commented 1 year ago

Preliminary Checks

Description

Markdown block has a shortcode called gallery. Its usage just like this:

{{< gallery album="path/to/demo" order="desc" resize_options="1024x1024" >}}

It usually works well. However, when path of an album contains capital letter, for example assets/media/albums/DEMO relative to project root, this statement will get an error like this during building:

ERROR 2022/12/17 11:55:43 Unable to load gallery `media/albums/DEMO/*` in `/home/runner/work/wowchemy-md-album-bug/wowchemy-md-album-bug/content/home/markdown.md`.
Error: Error building site: logged 1 error(s)
Total in 5643 ms
Error: Process completed with exit code 255.

Reproduction Link

https://github.com/jiabh/wowchemy-md-album-bug/

Steps to Reproduce

https://github.com/jiabh/wowchemy-md-album-bug/commit/ae238d45b69471c2ccc44ab2fbe930b85e8377d5

  1. Make an album with capital letters.
  2. Reference this album in a markdown block, as follows.
{{< gallery album="Demo" order="desc" resize_options="1024x1024" >}}
  1. Run hugo to build.

Expected Result

Build successfully, same as it was in lower case:

https://github.com/jiabh/wowchemy-md-album-bug/actions/runs/3719879953

Actual Result

Build failed with error Unable to load gallery.

https://github.com/jiabh/wowchemy-md-album-bug/actions/runs/3719894716

hugo: downloading modules …
hugo: collected modules in 5176 ms
Start building sites … 
hugo v0.108.0-a0d64a46e36dd2f503bfd5ba1a5807b900df231d+extended linux/amd64 BuildDate=2022-12-06T13:37:56Z VendorInfo=gohugoio
ERROR 2022/12/17 11:55:43 Unable to load gallery `media/albums/Demo/*` in `/home/runner/work/wowchemy-md-album-bug/wowchemy-md-album-bug/content/home/markdown.md`.
Error: Error building site: logged 1 error(s)
Total in 5643 ms
Error: Process completed with exit code 255.

What Hugo Module versions does your site use?

module github.com/wowchemy/starter-hugo-academic

go 1.15

require (
        github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify v1.0.0 // indirect
        github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify-cms v1.0.0 // indirect
        github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-reveal v1.0.0 // indirect
        github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5 v5.7.1-0.20221127215619-58b270a3e103
)

What operating system(s) are you seeing the problem on?

Linux

What browser(s) are you seeing the problem on?

No response

Which Wowchemy template are you using?

starter-hugo-academic

What version of Hugo are you using?

Hugo Extended 0.108.0

gcushen commented 1 year ago

Have you seen the Gallery docs at https://wowchemy.com/docs/content/writing-markdown-latex/#image-gallery ?

The Gallery docs state:

Album names must be lowercase due to a Hugo bug - consider up-voting the bug with a 👍

If you want to fix the bug in Hugo, you can submit a PR to the Hugo repo on Github: https://github.com/gohugoio/hugo/