Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add returnType: "html" option to return HTML directly #267

Closed
zachleat opened this issue Jan 3, 2025 · 2 comments
Closed

Add returnType: "html" option to return HTML directly #267

zachleat opened this issue Jan 3, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@zachleat
Copy link
Member

zachleat commented Jan 3, 2025

await eleventyImage("./test/bio-2017.jpg", {
  formats: ["auto"],
  returnType: "html",

  // passed to generateHTML
  htmlOptions: {
    imgAttributes: {
      alt: "",
    },
  },
});

Returns <img alt="" src="/img/KkPMmHd3hP-1280.jpeg" width="1280" height="853">

@zachleat zachleat added the enhancement New feature or request label Jan 3, 2025
@zachleat zachleat added this to the Eleventy Image v6.0.0 milestone Jan 3, 2025
@zachleat
Copy link
Member Author

zachleat commented Jan 3, 2025

Shipping with v6.0.0-beta.1

@zachleat zachleat changed the title Add return: "html" option to return HTML directly Add returnType: "html" option to return HTML directly Jan 7, 2025
@zachleat
Copy link
Member Author

zachleat commented Jan 7, 2025

v6.0.0-beta.3 went with returnType here instead of return (though return is still cheekily supported for now)—docs will show returnType (matches up better with the Fetch API)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant