liwenyip / hugo-easy-gallery

Automagical css image gallery in Hugo using shortcodes, with optional lightbox/carousel gadget using PhotoSwipe and jQuery.
MIT License
576 stars 111 forks source link

allow dots in thumb path or filename #17

Open it-gro opened 6 years ago

it-gro commented 6 years ago

Thx for hugo-easy-gallery! Awesome!

I fixed an issue with the shortcodes (figure.html, gallery.html) When a path or filename includes dot(s) a wrong thumb filename is assumed.

static/
├── css
│   └── hugo-easy-gallery.css
├── img
│   ├── gohugo.io
│   │   ├── hugo.ipsum.png
│   │   └── hugo.ipsum-thumb.png
│   ├── hugo-dolor.png
│   ├── hugo-dolor-thumb.png
│   ├── hugo.lorem.png
│   └── hugo.lorem-thumb.png
└── js
    └── load-photoswipe.js

e.g. {{< figure thumb="-thumb" link="/img/hugo.lorem.png" size="400x400" >}} gives: <img itemprop="thumbnail" src="/img/hugo-thumb.lorem-thumb.png" instead of <img itemprop="thumbnail" src="/img/hugo.lorem-thumb.png"

Test site is here: https://github.com/it-gro/HugoTestingHegDotIssue (using blank as theme)

I untabified gallery.html as well - but commited separately.

Thx again!

liwenyip commented 6 years ago

Thanks @it-gro, I'll review this asap.

HunterGraubard commented 6 years ago

Same issue here. I just came here to report it.

Edit: @it-gro's solution works great. Thanks.

liwenyip commented 5 years ago

@it-gro and @HunterGraubard sorry that "asap" has turned into 12 months. Having a look now.