resources

resources.ByType

返回给定媒体类型的全局资源集合;一个都没有时返回 nil。

签名
resources.ByType MEDIATYPE
返回类型
resource.Resources

媒体类型通常是 image、text、audio、video 或 application 之一。

{{ range resources.ByType "image" }}
  <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}