Add lazy loading of images in Jekyll posts
Normally you define images with ![]()
in markdown files. But jekyll also
provides a way to adding custom attributes to tags with {:attr="value"}
.
If you have lots of posts this command will append `` to all images in all your markdown files.
![image-title](/path/to/your/image.jpg)
will become
![image-title](/path/to/your/image.jpg)
Shell line bellow. Go into the folder where your posts are (probably _posts
).
find . -type f -name "*.md" -exec sed -i -E 's/(\!\[.*\]\((.*?)\))$/\1/' {} \;
Under the hood this adds loading="lazy"
to HTML img
nodes.
That is about it.
Other notes
- Grep to Less that maintain colors
- Make B/W SVG charts with matplotlib
- Alacritty open links with modifier
- Add lazy loading of images in Jekyll posts
- Aerial photography of algae spotted on river Sava
- plan9 My brand new Plan9/9front desktop
- Use option key as meta in Alacritty under macOS
- Convert all MKV files into other formats
- dcss Make DCSS playable on 4k displays
- Simple presentations with Markdown
- c Sending signals to C programs
- Using ffmpeg to combine videos side by side
- Online radio streaming with MPV from terminal
- Display xterm color palette
- Fix screen tearing on Debian 12 Xorg and i3