Skip to content

[Bug]: gallery and carousel shortcode are 0px without other statically sized elements #2611

@aurelien570

Description

@aurelien570

Issue Check

  • I have checked existing Issues and I feel this bug has not been raised

Hugo Version Check

  • My Hugo version is within the supported range

Describe the Bug

I’m experiencing a layout issue with the gallery and carousel shortcodes: images render extremely small unless adjacent content forces width.

To Reproduce

  1. Create a fresh Hugo site using Blowfish as theme.
  2. Add any jpg/png image to static folder (static\image_jpg.jpg and static\image_png.png in this example).
  3. Create a new content file (content/about.md in this example) with the following content (adapt it according to the names of your images) :
---
title: "title"
---

{{< gallery >}}
  <img src="/image_jpg.jpg" class="grid-w50" />
  <img src="/image_png.png" class="grid-w50"/>
{{< /gallery >}}

<!-- <div>Lorem ipsum</div> -->

{{< carousel images="{https://cdn.pixabay.com/photo/2016/12/11/12/02/mountains-1899264_960_720.jpg,gallery/03.jpg,gallery/01.jpg,gallery/02.jpg,gallery/04.jpg}" >}}

  1. Run
hugo server --noHTTPCache --disableFastRender

and check the local preview: there is neither gallery nor carousel
5. Uncomment the div in content/about.md then refresh and check the local preview again: the gallery and carousel are displayed

Note: the same result occurs when repeating the steps above but without class="grid-w50" in the <img> elements.

Expected Behaviour

The gallery and carousel elements should be visible independently of any other (statically sized) elements.

Screenshots

Image Image

Platform

  • OS: Ubuntu 24.04.3 LTS (on WSL)
  • Browser: Firefox 144.0.2 (64 bits)

Hugo Version

hugo v0.152.2+extended linux/amd64 BuildDate=unknown

Blowfish Version

v2.92.0

Additional Context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions