I finally put my photos up on my personal website. The only constraint I gave myself was to build a site that doesn’t need Javascript to load. In the end I ended up using Next.js as a static site generator that pulls all the routes from my directory structure, making it possible to add new photography collections and filters as I go. Might be overkill for the use case but it was fun to learn. The irony is I had to write a bunch of JS to produce it. Still need to optimize the image sizes and I am thinking about adding filters for b&w/color/format.
OP, have you tried loading="lazy" ? I don't know if it works with the picture tag but it is worth trying I think. Very often, webpages contain many images that contribute to data-usage and how fast a page can load. Most of those images are off-screen (non-critical), requiring user interaction (an example being scroll) in order to view them. Loading attribute
The loading attribute on an element (or the loading attribute on an
Good point I hadn't thought of that. Still have to troubleshoot it a bit in Firefox but it looks like its working in Chrome.
The resolution scaling is a good idea as well. I used the picture tag initially as a fallback for browsers that don't support webp images. More importantly I need to actually create scaled images which I have been putting off... Thanks for your comments/advice!
Looks great! I did something similar with hugo and tried to automate the process as much as possible.
I use a utility called jhead to resize, fix rotation issues, and rename photos by date - then I tied this to a folder action on macos so I can just drop photos in a folder and they get renamed and resized. Then Hugo has this cool 'smart' cropping feature which tries to crop based on content [1] - and the end result is now all I do is drop photos in a folder and publish and it comes out looking pretty good [2]. 1. https://gohugo.io/content-management/image-processing/#image... 2. https://www.danielecook.com/photos/
Nice! I found Hugo about halfway through working on this and it seemed like a great solution as well. The jhead utility would save me a ton of time as I ended up cross referencing my negatives to find processing dates which is all in the metadata.
You might want to add some copyright notice. Even if you don't want to monetize them is better for others to ask your permission rather then lose them to hoarders and later watch them making money and you get null.
Cool project! I set out to do something similar as well, but with a slight different scope. I wanted a web gallery that I can use to access all my (substantial) collection of pictures, that does not need any maintenance/work to get started. It lists directories and generates thumbnails on the fly, no database needed.
No JS would have been nice, but ended up making the content draw and re-flow in JS as I wanted to keep the aspect ratio of the thumbnails instead of showing a bunch of squares, for which a simple flexbox would have been enough. I still have to write a decent README https://gitlab.com/nicolazen/presto-photo-gallery
Comments (2,248) 1105 threads
Show all comments
Showing thread 7 of 1105
I finally put my photos up on my personal website. The only constraint I gave myself was to build a site that doesn’t need Javascript to load.
In the end I ended up using Next.js as a static site generator that pulls all the routes from my directory structure, making it possible to add new photography collections and filters as I go.
Might be overkill for the use case but it was fun to learn. The irony is I had to write a bunch of JS to produce it.
Still need to optimize the image sizes and I am thinking about adding filters for b&w/color/format.
Neat photos though.
OP, have you tried loading="lazy" ? I don't know if it works with the picture tag but it is worth trying I think.
Very often, webpages contain many images that contribute to data-usage and how fast a page can load. Most of those images are off-screen (non-critical), requiring user interaction (an example being scroll) in order to view them.
Loading attribute The loading attribute on an element (or the loading attribute on an
The resolution scaling is a good idea as well. I used the picture tag initially as a fallback for browsers that don't support webp images. More importantly I need to actually create scaled images which I have been putting off...
Thanks for your comments/advice!
I use a utility called jhead to resize, fix rotation issues, and rename photos by date - then I tied this to a folder action on macos so I can just drop photos in a folder and they get renamed and resized.
Then Hugo has this cool 'smart' cropping feature which tries to crop based on content [1] - and the end result is now all I do is drop photos in a folder and publish and it comes out looking pretty good [2].
1. https://gohugo.io/content-management/image-processing/#image...
2. https://www.danielecook.com/photos/
I ended up using sharp [1] since it was so easy to integrate into my workflow.
1. https://github.com/lovell/sharp
https://hansenzhang.com/copyright
No JS would have been nice, but ended up making the content draw and re-flow in JS as I wanted to keep the aspect ratio of the thumbnails instead of showing a bunch of squares, for which a simple flexbox would have been enough.
I still have to write a decent README
https://gitlab.com/nicolazen/presto-photo-gallery