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 }}