From c0a0df4fe9cbc2650b9dc5a59132cdbdca29d776 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Fri, 11 Jun 2021 23:39:48 +0200 Subject: [PATCH] Update resize_image docs --- CHANGELOG.md | 1 + .../content/image-processing/index.md | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c71244cd..76fbae35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ search in $BASE_DIR + $path, $BASE_DIR + static + $path and $BASE_DIR + content + $path 3. `get_file_hash` now returns base64 encoded hash by default 4. all functions working on files can now only load files in the Zola directory + 5. `resize_image` return value has changed ### Other diff --git a/docs/content/documentation/content/image-processing/index.md b/docs/content/documentation/content/image-processing/index.md index 30a4a310..4936f261 100644 --- a/docs/content/documentation/content/image-processing/index.md +++ b/docs/content/documentation/content/image-processing/index.md @@ -44,10 +44,24 @@ static/processed_images/ The filename of each resized image is a hash of the function arguments, which means that once an image is resized in a certain way, it will be stored in the above directory and will not -need to be resized again during subsequent builds (unless the image itself, the dimensions, or other arguments are changed). -Therefore, if you have a large number of images, they will only need to be resized once. +need to be resized again during subsequent builds (unless the image itself, the dimensions, or other arguments have changed). -The function returns a full URL to the resized image. +The function returns an object with the following schema: + +``` +/// The final URL for that asset +url: String, +/// The path to the static asset generated +static_path: String, +/// New image width +width: u32, +/// New image height +height: u32, +/// Original image width +orig_width: u32, +/// Original image height +orig_height: u32, +``` ## Resize operations