Poor man's html image gallery
For a personal website for which I hand-roll the html code, I wrote a small shell image link+thumbnail generator script. I shouldn't be proud, but I am.
The find | sort | awk
line is my preferred method for sorting by timestamp. It is not safe for files with spaces in the name, but who does that anyways?! (Ahem. [Well, not here obviously!]). Of course there are ways to make that happen, but it would be even less clean looking, and avoiding spaces is easy enough.
So like all good unix scripts, this just prints to stdout. I then copy-paste the contents and update my html file.
I haven't done extensive testing with non-square images. I'm pretty sure most images on my gallery are non-square, but everything seems to line up adequately.
And what gives away the fact that I'm a vim user?
And of course, some applicable css:
.thumb { max-width: 300px; max-height: 300px; }
Comments