blob: cc131378a6fbff79acbe3561e14d3a948f8c29ba (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
---
title: Height
description: Applicable to images, returns the height of the given resource.
categories: []
keywords: []
params:
functions_and_methods:
returnType: int
signatures: [RESOURCE.Height]
---
{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
```go-html-template
{{ with resources.Get "images/a.jpg" }}
{{ .Height }} → 400
{{ end }}
```
Use the `Width` and `Height` methods together when rendering an `img` element:
```go-html-template
{{ with resources.Get "images/a.jpg" }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}">
{{ end }}
```
|