Static Site Images

I was recently reaking this blog post by Kev Quirk about image handling on his static site which inspired me to spend some time fixing the images on this site.

My includes are fairly similar to his but I’m passing a class as well.


{{=<% %>=}}<img class="blogimg" alt="{{include.alt}}" loading="lazy" src="/assets/img/{{include.src}}" />

The image line in each post is identical to his handling.


{% include img.html src='' alt='' %}

Fun side note in creating this post I learned that you have to use {% raw %} and {% endraw %} tags so the liquid code wouldn’t run and replace that information. Also, these tags do not stack so you cannot show this code by putting raw/raw/endraw/endraw.

With this at least partially corrected I’ll be adding images to more posts going forward and revisiting the dark and light mode update with some images.

And here just because it would be bad form to have a post about images without including an image.

T-Rex roaring in an urban downtown area Photo by Huang Yingone

This is day 5 of #100DaysToOffload.


Comments

Comment on this blog post by publicly replying to this Mastodon post using a Mastodon or other ActivityPub/​Fediverse account. Known non-private replies are displayed below.

No known comments, yet. Reply to this Mastodon post to add your own!