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

Image shortcode properties as object #27

Open
mvsde opened this issue Jun 2, 2022 · 0 comments
Open

Image shortcode properties as object #27

mvsde opened this issue Jun 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@mvsde
Copy link
Member

mvsde commented Jun 2, 2022

For easier extension of the image shortcode later, it may be useful to switch to an object-based configuration like this:

{{ image({src: "test.jpg", alt: "Hello World", classes: ["test"]}) }}

Instead of a single additionalAttributes property, we can collect all “unknown” properties and “spread” them onto the image element.

I build something similar here: https://github.com/mvsde/website/blob/d8c67a2b7333d8ddd36993cfdd9a9dade6558769/.eleventy/shortcode-image.js#L22

This keeps the shortcode options uniform and reflects how attributes work in “normal” HTML.

@mvsde mvsde added the enhancement New feature or request label Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant