CTA Card
A high-contrast call-to-action card — bold headline, supporting line, and a button to drive the next step.
An image gallery with grid and masonry layouts, click-to-zoom lightbox, and lazy-loaded placeholders.
Add it to any Hugo page's sections list — no build step.
Quick start
Drop this into your page's front matter, under the sections list. Edit the values, and HugoBlox renders the block — no build step.
- block: gallery
content:
title: Lab tour
subtitle: Highlights from the 2026 retreat — full set in our [archive](/photos/).
items:
- src: media/albums/lab-2024/01.jpg
caption: The **main workspace** where most of our research happens
credit: "Photo: [Jane Doe](https://janedoe.com)"
- src: media/albums/lab-2024/02.jpg
title: Annual retreat
caption: "*Edinburgh, 2024* — three days of deep work and walks"
link: /news/retreat-2024/
design:
layout: grid
columns: 4
gap: md
aspect_ratio: square
caption_position: below
hover_zoom: true
lightbox: trueFlexibility
Switch the block's design with these presets — no custom CSS.
layoutLayout style. Grid produces uniform tiles; masonry packs variable-height images; justified row-balances images Flickr-style; carousel is a horizontal scroll-snap strip; slideshow shows one image at a time with optional autoplay.gapSpacing between tiles.aspect_ratioTile aspect ratio. Applies to grid, carousel, and slideshow layouts. Masonry uses each image's natural aspect ratio; justified packs rows by natural ratio at the configured row height.caption_positionWhere captions appear on each tile.Reference
Every option the Gallery block accepts, generated from its schema.
Properties set under the block's content key.
| Property | Type | Default | Description |
|---|---|---|---|
title | string | — | Section heading shown above the gallery (supports inline Markdown bold/italic). |
subtitle | string | — | Supporting sentence below the title — context, dates, or photographer credit line. |
items | object[] | — | Curated list of images. Use when you want explicit ordering and per-image captions/credits. For drop-in folder use, prefer the album field instead. |
items[].srcrequired | string | — | Image source. Either a path under assets/ (e.g. 'media/photos/keynote.jpg' or 'albums/lab-2024/01.jpg'), or a remote URL (https://…). Page-bundle resources can also be referenced by filename if the gallery sits inside a page bundle. |
items[].title | string | — | Short headline shown above the caption (lightbox + below-caption layouts). Supports inline Markdown. |
items[].caption | string | — | Image caption shown in the lightbox and (depending on layout) beside or over the tile. Supports inline Markdown — bold, italic, inline code, and links all work. Setting caption here overrides any caption coming from a sidecar file or embedded EXIF/IPTC tags on this image. |
items[].alt | string | — | Plain-text alternative for screen readers and search engines. Defaults to the plainified caption (or humanised filename if no caption). Override when the visual content of the image differs from its caption. |
items[].credit | string | — | Photo credit line shown in the lightbox footer. Supports inline Markdown — perfect for `Photo: [Name](https://photographer-site.com)`. |
items[].link | string | — | Optional URL — adds an 'Open page →' link in the lightbox footer that navigates to this page. Useful when each image represents a project, talk, or publication with its own detail page. |
album | string | — | Folder path (relative to assets/) to auto-load images from. All image files (.jpg/.png/.webp/.gif/.avif/.svg) in the folder are picked up and sorted by filename. Captions, titles, credits, and links can be supplied per image via a sidecar file next to each image — `<image>.jpg.yaml` (Lightroom-style) or `<image>.yaml` (clean) — without listing every image in items[]. JPEGs with embedded IPTC/EXIF tags (from Lightroom/Capture One exports) are also picked up automatically. |
page_resources | boolean | false | Auto-discover image resources attached to the current page bundle. Useful for blog posts and project pages where photos live next to index.md — drop them in and they appear as a gallery. Sidecar files inside the bundle are resolved the same way as for album mode. |
sort | asc | desc | asc | Sort order applied to album-loaded images (ignored when using items[], which preserves the explicit order). |
limit | integer | 0 | Maximum number of images to display. Useful for capping an album to the most recent N. Set to 0 (default) for no limit. |
Properties set under the block's design key — shared background, spacing, and color settings apply on top.
| Property | Type | Default | Description |
|---|---|---|---|
layout | grid | masonry | justified | carousel | slideshow | grid | Layout style. Grid produces uniform tiles; masonry packs variable-height images; justified row-balances images Flickr-style; carousel is a horizontal scroll-snap strip; slideshow shows one image at a time with optional autoplay. |
columns | integer | 3 | Number of columns at the widest breakpoint. Scales down responsively. For grid/masonry: number of stacked columns. For carousel: number of items visible at desktop width (mobile always shows ~1 with the next peeking). Ignored for justified and slideshow. |
row_height | integer | 240 | Target row height in pixels — justified layout only. Each row is rendered at this height; widths within the row are derived from each image's aspect ratio. |
autoplay | boolean | false | Slideshow layout only — auto-advance to the next slide on an interval. Pauses on hover and resets when the user manually navigates. |
autoplay_interval | integer | 5000 | Milliseconds between slides when autoplay is enabled. Clamped to a minimum of 1000ms. |
gap | sm | md | lg | md | Spacing between tiles. |
aspect_ratio | square | landscape | portrait | wide | square | Tile aspect ratio. Applies to grid, carousel, and slideshow layouts. Masonry uses each image's natural aspect ratio; justified packs rows by natural ratio at the configured row height. |
caption_position | below | overlay | hover | none | below | Where captions appear on each tile. |
hover_zoom | boolean | true | Subtle scale-up on hover for grid tiles. Adds a tactile, interactive feel. |
lightbox | boolean | true | Open a full-viewport lightbox on click, with keyboard navigation (← → Esc) and touch swipe. Disable to make tiles either inert or link-only (when items[].link is set). |
Compose
Blocks that pair naturally with Gallery on the same page.
Frequently asked
Ready to build with the Gallery block?
More blocks like this
A high-contrast call-to-action card — bold headline, supporting line, and a button to drive the next step.
Introduce your team, lab, or studio with grouped, filterable member profiles.
Turn happy customers into social proof — quote cards with avatars, names, and roles.