jpvalery / portfolio

Photo Portfolio w/ Next.js + TailwindCSS + Contentful

Home Page:https://jpvalery.photo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Display subGallery name on extendedGallery page if there are multiple subGalleries

jpvalery opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
I removed the title of the subGallery so it woldn't display. Indeed, most of my extendedGallery just have a single subGallery. Thus, it wouldn't make much sense to have it displayed twice.

However, now that I'm putting out more galleries with multiple subGalleries, I'd like to have the title displayed.

Describe the solution you'd like
A way to conditionally display the name of the subGalleries if they are more than 1 in the page.
If multiple subGalleries, display <name of the subGallery>, else do not display it

Additional info
Pretty sure it's src/templates/gallery.js that needs to be fine tuned (lines 22 to 34 i presume)

Any help or suggestion is welcome :)

commented

Tried it a bit and ran into an issue as every gallery is contain in a different div.

So only-of-type for h2 always apply.

I need to find a way to do div:only-of-type h2 (?)

commented

Possible with Tailwind only: but not relevant anymore.