Skip to content

Error calling Width in process_responsive_image.html with SVG #3305

@CravateRouge

Description

@CravateRouge

When having a SVG in a cta-custom-paragraph like this:

- block: cta-image-paragraph
    content:
      title: Some title
      text: Some text
      items:
        - title: Some item title
          image: pic.svg
          text: |
            Here is a text description

Youg get the following error because a SVG image doesn't have a Width parameter:

_partials/functions/process_responsive_image.html:142:88: executing "_partials/functions/process_responsive_image.html" at <$image.Width>: error calling Width: this method is only available for raster images.

Error is here on last commit:

{{- $srcset_parts = $srcset_parts | append (printf "%s %dw" $image.RelPermalink $image.Width) -}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions