A filter to print the input image in different predefined image sizes.
Project description
image-filter
A Lektor filter to print the input image in different predefined image sizes.
This plugin is designed to work together with the lektor-image-resize Plugin.
Current Filters:
webpimagesizes
will print the configured webp image sized based on the input file name.jpgimagesizes
will print the configured jpg image sized based on the input file name.
Configuration
You can configure the image width in the config file called configs/image-resize.ini
and add
a few sections for images. The section names can be whatever you want, the
final images will be called $(imagename)-$(sectionname).jpg
and $(imagename)-$(sectionname).webp
.
If the max_width
enty does not exist the entry will be ignored.
Here is a example config file:
[small]
max_width = 512
[medium]
max_width = 900
max_height = 900
[woowee]
max_width = 1440
Example Output
Lektor Jinja2 Input
<img {{ 'waffle.jpg'|webpimagesizes }} />
Lektor HTML Output:
<img src="waffle-small.webp" width="512"
srcset="waffle-small.webp 512w,
waffle-medium.webp 900w,
waffle-woowee.webp 1440w," />
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for lektor_image_filter-0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55c2c2b3c55cc6049de8b71dc9e39c608ed96bf8572c1b7e326e20ed71e31886 |
|
MD5 | 110a3e74493815c1df550c271fae3137 |
|
BLAKE2b-256 | d1611511cddc302c081061fdc92efe714030a9d9506e52706475be4df4283bf7 |