kc0bfv / autophugo

AutoPhugo [ˌɔtoʊˈfjuːgəʊ] is a gallery/photoblog theme for Hugo that's a little more automatic than Phugo.
Other
97 stars 56 forks source link

use filename hash, not index, to reference images in detail view #29

Closed githubmonkey closed 2 years ago

githubmonkey commented 2 years ago

The aim of this change list is to move away from using the position as image identifier in favor of the filename. This is based on the assumption that an author is less likely to rename a previously published file than they are to add another image to the collection.

I initially tried to use the url escaped filename directly but ran into problems with the javascript click_hash function whenever my filenames contained spaces or other symbols. In the end, I actually like the md5 hash better as it is not only safer but also less distracting.

In general, I consider this change to be universally useful, therefore I did not offer a feature flag to toggle. Of course, it would be easy to add one if desired.

kc0bfv commented 2 years ago

Yup - this is probably the way I should've done it initially. I was going to have to make this a breaking change because of the few people that might have used the image_number version and shared links... BUT! I came up with a way of making both work ;-) Adding to cur_ver

kc0bfv commented 2 years ago

On main now.