From 4f0755683cf94498d2b7f205a459800d611f1557 Mon Sep 17 00:00:00 2001 From: Nathan Lovato Date: Sat, 3 Apr 2021 13:41:42 -0600 Subject: [PATCH] Improve the documentation of imageConfig and the image resource - Added information about the expected argument type when calling imageResource. - Added a warning regarding calling imageConfig with incorrect arguments. - Added information about two properties the `image` resource provides. Co-authored-by: jmooring --- content/en/content-management/image-processing/index.md | 6 +++++- content/en/functions/images/index.md | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index 710c260ca..f2748f5db 100644 --- a/content/en/content-management/image-processing/index.md +++ b/content/en/content-management/image-processing/index.md @@ -28,7 +28,11 @@ content/ └── sunset.jpg <-- page resource ``` -To access an image as a page resource: +## The Image Resource + +The `image` resource gives you access to image-specific attributes like the picture's `Width` and `Height`, as well as powerful processing methods and filters. More on that below. + +Note that the `image` resource can also be retrieved from a [global resource]({{< relref "/hugo-pipes/introduction#from-file-to-resource" >}}) ```go-html-template {{ $image := .Resources.GetMatch "sunset.jpg" }} diff --git a/content/en/functions/images/index.md b/content/en/functions/images/index.md index 92c6ff0da..7dd5843ee 100644 --- a/content/en/functions/images/index.md +++ b/content/en/functions/images/index.md @@ -218,6 +218,8 @@ Also see the [Filter Method](/content-management/image-processing/#filter). Parses the image and returns the height, width, and color model. +The `imageConfig` function takes a single parameter, a file path (_string_) relative to the _project's root directory_, with or without a leading slash. + {{% funcsig %}} images.ImageConfig PATH {{% /funcsig %}}