11ty / 11ty/image

Warning about bad formats order or maybe some reordering of outputs object?

Open
#71 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feature: `formats` option
Dominant language
JavaScript
Stars
467
Forks
65
PR merge metrics
No merged PRs in 30d

Description

If you use formats: ["jpeg", "webp", "avif"] the generateHTML utility will generate markup with <source> in the wrong order.

There is some intentional behavior there that we wouldn’t want to destroy, maybe you’d want "jpeg", "png" or "png", "webp". At this point in time "avif" should never be last though. And it’s very unlikely "webp" would come after "jpeg" or "png". I doubt you’d want "webp" before "avif" too.

So, not sure. I think warnings are in order so that we can lean towards teaching instead of using automation to protect from requiring the knowledge.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the generateHTML utility and trace how the formats array determines the order of generated elements. Clarify the intended ordering and warning conditions for jpeg, png, webp, and avif before implementing anything; done means the behavior is documented by tests or examples and inappropriate ordering produces the agreed warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.