Hugo 主题
注意 1: 请参阅此 Gallery Deluxe 入门指南,快速上手并运行。
注意 2: 如果您需要多个画廊,请参阅 Galleries Deluxe。
- 配置
- 鸣谢
一个用于显示照片画廊的 Hugo 模块。它非常快速/有效,尤其是在您显示大量图像时。
此主题是您在 staticbattery.com 上看到的内容,在撰写本文时,该网站在 Google PageSpeed 上移动端和桌面端均获得 100 分。
配置
推荐将此模块添加到您站点的方法是将其作为 Hugo 模块包含在内。有关入门模板,请参阅 Gallery Deluxe 入门指南。另一个示例是 staticbattery.com。
参数
[params]
[params.gallerydeluxe]
# Shuffle the images in the gallery to give the impression of a new gallery each time.
shuffle = false
# Reverse the order of the images in the gallery.
reverse = false
# Enable Exif data in the gallery.
# See https://gohugo.com.cn/content-management/image-processing/#exif-data for how to filter tags.
enable_exif = false
# Optional watermark file for the large images.
[params.gallerydeluxe.watermark]
image = "images/gopher-hero8.png" # relative to /assets
posx = "left" # one of "left", "center", "right"
posy = "bottom" # one of "top", "center", "bottom"
如果您想完全控制图像的创建方式,请在您自己的项目中创建并调整 layouts/partials/gallerydeluxe/create-thumbs.html 的副本。
鸣谢
感谢 Dan Schlosser 的 Pig JS 库。