1

在 Mac 上为从 brew 安装的本地开发者运行 hugo 0.61。

hugo version
Hugo Static Site Generator v0.61.0/extended darwin/amd64 BuildDate: unknown

当我使用figure简码时srcwidth, 和height属性有效,但caption, title,linkalt似乎没有。

页面代码:

{{< figure src="images/rpi_up.png" link="images/rpi_up.png" width="400" height="200" alt="All 4 Raspberry Pi nodes came up cleanly on the first try" title="All 4 Raspberry Pi nodes came up cleanly on the first try" >}}

https://gohugo.io/content-management/shortcodes/#figure的示例似乎title用于caption- 我已经尝试了两种方式)

呈现以下 HTML 时没有错误:

<div class="columns is-centered container">
    <div class="column is-full">
        <figure>
            <img class="rounded-corners" src="/work/kubernetes/kube_117_on_rpi_4/images/rpi_up_huefe7661fd5aa8ec47e26b05b16d13406_10693_400x200_resize_box_2.png" 
                width="400" 
                height="200">
        </figure>
    </div>
</div>

我缺少一些要求或配置吗?我没有看到文档中提到的任何内容。

4

1 回答 1

1

我发现短代码是每个主题的。我使用的它们有一个非常简单的短代码,只引入了宽度和高度属性。我找到了一个更完整的并对其进行了修改以满足我的需要。

于 2019-12-23T13:41:52.000 回答