Figure
Creates a semantically sound <figure> element with optional <figcaption>. Works great with Eleventy's own image optimization pipeline.
Add alternative text with alt (strongly recommended!), an id to reference the image from elsewhere, and attribution for copyrighted images.
| Argument | Type | Required |
|---|---|---|
| src | string |
yes |
| alt | string |
no |
| caption | string |
no |
| id | string |
no |
| attribution | string |
no |
Usage
{% figure "https://placehold.co/1600x900", "image in figure with obligatory alt text", "Caption of this figure, including custom id for linking.", "test-figure-1", "https://example.com/attribution-for-image" %}
Example
...