Height
适用于图像,返回给定资源的高度。
Syntax
RESOURCE.Height
Returns
int
{{ with resources.Get "images/a.jpg" }}
{{ .Height }} → 400
{{ end }}渲染 img 元素时一起使用 Width 和 Height 方法:
{{ with resources.Get "images/a.jpg" }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}">
{{ end }}