HugoPhotoSwipe
HugoPhotoSwipe copied to clipboard
Allow for any number of output sizes
Currently, HugoPhotoSwipe allows for three output sizes: large, small, and thumbnail. Additionally it supports the coverimage output using the cover
output size. A feature idea I had was to generalize this to allow users to specify more different sizes. This would change the configuation from the current form (v0.0.15):
dim_max_cover: 600x600
dim_max_large: 1200
dim_max_small: 600
dim_max_thumb: 256x256
dirname_large: large
dirname_small: small
dirname_thumb: thumb
to something like this:
sizes:
large:
max_dim: '1600'
use_smartcrop: false
small:
max_dim: '800'
use_smartcrop: false
thumb:
max_dim: '256x256'
use_smartcrop: true
cover:
max_dim: '600x600'
use_smartcrop: true
In this setup, cover
would have a special role, but for all the other sizes the name of the size will correspond to the old dirname_
setting, and there is the added option of using smartcrop for other sizes too. Additional sizes can be added by adding an item under the sizes
setting. This could allow users to add other sizes for their specific website design, such as a super
size for downloading a really large version of the image for instance. A side benefit for this setup is that it would simplify the code of HugoPhotoSwipe.
Is this a feature that you find interesting and useful? If so, leave a :+1: reaction to this issue
Ideas on how it could be implemented differently? Let me know below!