Gallery
gallery fence, each with an optional description or link.A gallery puts related images side by side so readers can compare them: the
screens of a setup wizard, the light and dark versions of a dashboard, the
same chart before and after a fix. You write one image per line inside a
gallery fence, and the theme lays them out as a grid that drops columns as
the screen narrows.
Use an image for a single picture. Images without an order or a comparison between them are better as separate figures in the text.
Shortest form
Each line is a Markdown image, .
Always write the alt text. It is the item’s title, the only text a screen reader announces for it, and what makes the image eligible for zoom. There is no column setting: the grid follows the width of its container.
Descriptions
Put # after the image to add a description under it. Descriptions are
plain text, so Markdown in them shows literally; write \# for a literal hash.

The default shell: sidebar, article, table of contents

Docsy upstream — the content model is the same lineage

Release cards use release_url and date; checksums blocks list download assets
Descriptions may differ in length: the items in a row line up with the tallest
one, and a description that wraps does not push its neighbors around. The
image is parsed before the description, so a # inside alt text or a path
needs no escaping.
A link per item
Add {link=…} at the end of a line to make that item a link, for example to
the page that explains the screen. Site paths, relative paths and http(s):
URLs are accepted.
A click on a linked item follows the link, so that item does not zoom. One gallery can mix both kinds: linked items open their page, the others open the full image.
Where images come from
Each source is looked up like a plain image: a page resource in the page
bundle, then a global resource under assets/, then a static path such as
/images/…, then a remote URL. The theme reads the size of local resources
and writes it into the page, so the grid does not jump while images load.
Remote images are neither downloaded nor measured at build time.

Under assets/images/…, eligible for build-time processing

Under static/images/…, published as is
A page or global resource that cannot be found is kept as a static path. The theme does not check whether static paths or remote URLs exist, so a typo there shows up as a broken image in the browser.
Decorative images and zoom
Empty alt text marks an image as decorative: it gets no title, screen readers skip it, and it never zooms.
Image zoom is off by default and turned on with params.ui.image_zoom for the
whole site or with image_zoom in a page’s front matter; this page does the
latter. Every image above that has alt text and no link opens at full size,
and Esc closes it and returns focus to the image.

Decorative, never zooms

Has alt text, so it opens
Galleries reuse the page’s single zoom dialog instead of bringing their own, and the zoom script loads only when the page has at least one image that can zoom. Images · Zoom lists the full rules.
Classes and tabs
class adds a CSS class for your own styles, either to the whole fence (after
the language) or to one item (at the end of its line); the theme passes it
through without interpreting it. A fence with tab= (and group= /
value=) becomes one panel of a tab set, which
suits one gallery per platform or per color scheme.

Sidebar, article, table of contents

The same content-model lineage
Output
Galleries load no script of their own, and every image is lazy-loaded. Print
and RSS stack the images without zoom, and the page’s Markdown output keeps
the gallery fence as you wrote it.
Parameter reference
The line syntax  [# description] [{key=value …}]:
Fence attributes:
There is no columns, caption or title attribute. A malformed line or
attribute warns with its line number in the fence, and only the broken part or
line is dropped.
Limits
- The fence is the only form; there is no
{.gallery}list marker and no shortcode. GitHub therefore shows the source rather than the images. - You cannot set the number of columns, and images keep their own proportions instead of being cropped to a common shape.
- There is no slideshow, carousel or previous / next control; the zoom dialog shows one image at a time.
- Remote images are not downloaded at build time, so their size is unknown until the browser loads them and the layout can shift.
- Descriptions do not render Markdown; put rich text in a paragraph below the gallery.
For a whole album with a sidebar, page-by-page browsing and drag-to-pan
viewing, use the Expo layout; a gallery fence is for a
group of images inside a text page.
Related
- Images — single images, captions, numbering, the zoom switch
- Cards — a grid of links with images
- Tabs — one gallery per platform or theme
- File trees — the same line syntax family