mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
a49f838cd0
Add imageConfig function which calls image.DecodeConfig and returns the height, width and color mode of the image. (#2677) This allows for more advanced image shortcodes and templates such as those required by AMP. layouts/shortcodes/amp-img.html ``` {{ $src := .Get "src" }} {{ $config := imageConfig (printf "/static/%s" $src) }} <amp-img src="{{$src}}" height="{{$config.Height}}" width="{{$config.Width}}" layout="responsive"> </amp-img> ``` |
||
---|---|---|
.. | ||
404.md | ||
ace.md | ||
amber.md | ||
blocks.md | ||
content.md | ||
debugging.md | ||
functions.md | ||
go-templates.md | ||
homepage.md | ||
list.md | ||
overview.md | ||
partials.md | ||
rss.md | ||
sitemap.md | ||
terms.md | ||
variables.md | ||
views.md |