模块支持 Bootstrap v5 开箱即用,若你并不使用 Bootstrap,则需要对配置进行调整。
成为我们的资助者或赞助商,以支持我们的工作。
hugo.yaml
1params:
2  hugomods:
3    images:
4      modern_format: webp
hugo.toml
1[params]
2  [params.hugomods]
3    [params.hugomods.images]
4      modern_format = 'webp'
hugo.json
1{
2   "params": {
3      "hugomods": {
4         "images": {
5            "modern_format": "webp"
6         }
7      }
8   }
9}
v0.8.3 开始,params.images 重命名为 params.hugomods.images,以避免于 Hugo 内置目录冲突,详情请参阅 https://github.com/hugomods/images/issues/26。alignment_center_class_name| 名称 | 上下文 | 类型 | 必填 | 默认值 | 版本 | 示例 | 
|---|---|---|---|---|---|---|
alignment_center_class_name | - | string | - | d-block text-center | - | - | 
居中时 <picture> 和 <figure> 的类名。
alignment_end_class_name| 名称 | 上下文 | 类型 | 必填 | 默认值 | 版本 | 示例 | 
|---|---|---|---|---|---|---|
alignment_end_class_name | - | string | - | float-end ms-2 | - | - | 
右侧浮动时 <picture> 和 <figure> 的类名。
alignment_start_class_name| 名称 | 上下文 | 类型 | 必填 | 默认值 | 版本 | 示例 | 
|---|---|---|---|---|---|---|
alignment_start_class_name | - | string | - | float-start me-2 | - | - | 
左侧浮动时 <picture> 和 <figure> 的类名。
class_name| 名称 | 上下文 | 类型 | 必填 | 默认值 | 版本 | 示例 | 
|---|---|---|---|---|---|---|
class_name | - | string | - | img-fluid | - | - | 
<img> 的类名。
figure_class_name| 名称 | 上下文 | 类型 | 必填 | 默认值 | 版本 | 示例 | 
|---|---|---|---|---|---|---|
figure_class_name | - | string | - | figure | - | - | 
<figure> 的类名。
figure_caption_class_name| 名称 | 上下文 | 类型 | 必填 | 默认值 | 版本 | 示例 | 
|---|---|---|---|---|---|---|
figure_caption_class_name | - | string | - | figure-caption | - | - | 
<figcaption> 的类名。
figure_image_class_name| 名称 | 上下文 | 类型 | 必填 | 默认值 | 版本 | 示例 | 
|---|---|---|---|---|---|---|
figure_image_class_name | - | string | - | figure-img | - | - | 
当设置了说明文本,该类名将会追加到 <img>。
modern_format| 名称 | 上下文 | 类型 | 必填 | 默认值 | 版本 | 示例 | 
|---|---|---|---|---|---|---|
modern_format | - | string | - | webp | - | - | 
生成现代图片格式,为空则禁用。