coderedcorp / coderedcorp/wagtail-seo

Preview images use original as default, which may be too large and preview might not be generated

Open
#76 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
93
Forks
30
PR merge metrics
No merged PRs in 30d

Description

https://github.com/coderedcorp/wagtail-seo/blob/ce369cd07cafe64b983dd056f15dd4763df11b5c/wagtailseo/models.py#L480

The preview image uses the original image that was uploaded, which does not make sense in my opinion. A lot of platform have limits as to how big an image has to be in order for it to be shown on the preview, for example facebook has a limit of 8MB: https://developers.facebook.com/docs/sharing/webmasters/images/

The better way to do it would be show at least the webp or avif version of the image, if that is available. This more closely aligns with the philosophy of allowing content creators and editors to just upload images and having wagtail take care of the rest.

I am open to creating a pull request for this myself if this solution is accepted.

Contributor guide

Open the contributing guide

Research direction

Start by inspecting wagtailseo/models.py at the linked line to understand how the preview image is selected. Confirm how available WebP or AVIF versions can be used, then verify that previews prefer one of those versions instead of the original image when available.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.