mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
This commit is contained in:
27
docs/content/en/methods/resource/Height.md
Normal file
27
docs/content/en/methods/resource/Height.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: Height
|
||||
description: Applicable to images, returns the height of the given resource.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- methods/resource/Width
|
||||
returnType: int
|
||||
signatures: [RESOURCE.Height]
|
||||
---
|
||||
|
||||
```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 }}
|
||||
```
|
||||
|
||||
{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
|
Reference in New Issue
Block a user