{{imageDimensions}} helper

Create height/width attributes for a given image. Use it with images from theme options, so the browser can reserve space for the image before it loads. Publii reads the dimensions from the image file during rendering. It is often used with responsiveImageAttributes; see How images work in Publii.

Syntax:

{{imageDimensions IMAGE_PATH}}

Example:

{{imageDimensions @config.custom.imageOptionName}}

Create your first website with Publii

Join thousands of creators who chose independence. Create content locally and publish lightning-fast, secure websites on your own terms.

Download Publii

Free and open source. Windows, macOS and Linux.

Read the getting started guide