diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index 01728f558..aaef7d80f 100644 --- a/content/en/content-management/image-processing/index.md +++ b/content/en/content-management/image-processing/index.md @@ -475,7 +475,9 @@ includeFields : Regular expression matching the EXIF tags to include in the `.Tags` collection. Default is `""`. To include all available tags, set this value to `".*"`. {{% note %}} -To improve performance and decrease cache size, if you set neither `excludeFields` nor `includeFields`, Hugo excludes the following tags: `ColorSpace`, `Contrast`, `Exif`, `Exposure[M|P|B]`, `Flash`, `GPS`, `JPEG`, `Metering`, `Resolution`, `Saturation`, `Sensing`, `Sharp`, and `WhiteBalance`. +To improve performance and decrease cache size, Hugo excludes the following tags: `ColorSpace`, `Contrast`, `Exif`, `Exposure[M|P|B]`, `Flash`, `GPS`, `JPEG`, `Metering`, `Resolution`, `Saturation`, `Sensing`, `Sharp`, and `WhiteBalance`. + +To control tag availability, change the `excludeFields` or `includeFields` settings as described above. {{% /note %}} ## Smart cropping of images diff --git a/layouts/shortcodes/imgproc.html b/layouts/shortcodes/imgproc.html new file mode 100644 index 000000000..c09133ba8 --- /dev/null +++ b/layouts/shortcodes/imgproc.html @@ -0,0 +1,37 @@ +{{- /* +Renders the given image using the given process specification. + +@param {string} (positional parameter 0) The path to the image, relative to the current page. The image must be a page resource. +@param {string}} (positional parameter 1) The image processing specification. + +@returns template.HTML + +@example {{< imgproc "sunset.jpg" "resize 300x" />}} +*/}} + +{{- with $.Get 0 }} + {{- with $i := $.Page.Resources.Get . }} + {{- with $spec := $.Get 1 }} + {{- with $i.Process . }} +
+ +
+ + {{- with $.Inner }} + {{ . }} + {{- else }} + {{ $spec }} + {{- end }} + +
+
+ {{- end }} + {{- else }} + {{- errorf "The %q shortcode requires a positional parameter (1) containing the image processing specification. See %s" $.Name $.Position }} + {{- end }} + {{- else }} + {{- errorf "The %q shortcode was unable to find %q. See %s" $.Name . $.Position }} + {{- end }} +{{- else }} + {{- errorf "The %q shortcode requires a positional parameter (0) indicating the image path, relative to the current page. See %s" $.Name $.Position }} +{{- end }}