Gallery Layout Document
Gallery layout is useful for demonstrating pictures and its statistical data.
This layout can be used on both section page and regular post.
Configuration
Specify
type
in front-matter will change the template lookup order.
gallery_resources
Content resources. URL can be an absolute path (with /
prefix, relative to base URL), or relative path (without /
, relative to current path)
Hugo will handle multilingual scenario out of the box
For example:
default: error will occur in page
Resouces Configuration
These settings are under the resource specified in gallery_resources
.
title
Title of image.
default: no title
gallery_title_link
Link of the title.
default: no title link
gallery_img_src
Image URL relative to the base URL. (with or without /
prefix)
For example:
default: no image
gallery_img_link
Link of the image.
default: no image link
gallery_img_caption
Caption of the image. HTML is available.
default: no figure caption under image
gallery_statistic
Statistic of the image. The format is:
key and value both support markdown syntax.
default: no figure caption under image
weight
default: default order
Headless Bundle
Hugo supports an amazing feature called Headless Bundle, which elegantly resolved the resouces publish issue.
For example, if you don’t want to publish the resouces of the gallery layout, you can create a leaf bundle and specified headless = true
in index.md
’s front-matter. These resources will only be used during rendering process. In other word, no file will be generated to /public
folder.
Checkout Headless Bundle for more details.