Skip to content

Serve images in next-gen formats #652

Answered by rmdhnreza
Mryuksel101 asked this question in Q&A
Discussion options

You must be logged in to vote
  1. You can convert images manually to WebP, for example with squoosh.app
  2. Automatically using render-image hooks.
    Edit layouts/_default/_markup/render-image.html and add webp to line 21-22

{{- $small := $image.Resize `480x` -}}
{{- $big := $image.Resize `1024x` -}}

like this

...

 {{- $small := $image.Resize `webp 480x` -}} 
 {{- $big := $image.Resize `webp 1024x` -}}

...

make sure you enable imageProcessing on config.yaml

imageProcessing:
cover:
enabled: true
content:
enabled: true

AFAI…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Mryuksel101
Comment options

@rmdhnreza
Comment options

Answer selected by Mryuksel101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants