Created
September 5, 2019 13:37
-
-
Save zachleat/f43c3d461df1e6ba3272cea6e4f7b50d to your computer and use it in GitHub Desktop.
Experimenting with a Nunjucks shortcode for images in Eleventy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- throws an error, missing [alt] attribute --> | |
{% img src="img/9a93578a.png", loading="lazy" %} | |
<!-- local img source, outputs a standard <img> tag --> | |
{% img src="img/9a93578a.png", alt="zachleat’s Avatar", loading="lazy" %} | |
<!-- remote img source --> | |
<!-- download using avatar-local-cache, outputs <picture> with webp and png fallback --> | |
{% img src="https://www.gravatar.com/avatar/e1899004c71c7043343196103e210be3?default=404", alt="zachleat’s Avatar", loading="lazy" %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment