Adding photo gallery to Quarto #5972
Replies: 9 comments 10 replies
-
There is an extension that makes some of this pretty easy, though I'm not 100% sure it is what you're looking for exactly. Here is more about that extension: https://github.com/quarto-ext/lightbox More specifically https://github.com/quarto-ext/lightbox#galleries HTH! |
Beta Was this translation helpful? Give feedback.
-
Initially, I was trying Masonry.js, but It turned out to be tricker than I thought to get it to work properly within Quarto. Using pur Bootstrap and the lightbox extension you can get something not as pretty as Masonry.js but not that bad either. Screen.Recording.2023-06-19.at.20.54.23.mov---
title: "Image gallery"
format: html
filters:
- lightbox
lightbox: auto
---
::: {style="display: grid;grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));grid-gap: 1em;"}
![](https://source.unsplash.com/jlzxJuSINsw){group="my-gallery"}
![](https://source.unsplash.com/a-brown-dog-laying-on-top-of-a-white-bed-90ub4oBH1WU){group="my-gallery"}
![](https://source.unsplash.com/ZJVXcRmaSJM){group="my-gallery"}
![](https://source.unsplash.com/cVpfbLcm0Bo){group="my-gallery"}
![](https://source.unsplash.com/a-white-cat-laying-on-top-of-a-white-curtain-fIkdTouhWMg){group="my-gallery"}
![](https://source.unsplash.com/78YxP3PP05A){group="my-gallery"}
![](https://source.unsplash.com/PU1Yqe9kNpg){group="my-gallery"}
![](https://source.unsplash.com/uutHQEjfx3g){group="my-gallery"}
![](https://source.unsplash.com/JcIFJnZDUHQ){group="my-gallery"}
::: |
Beta Was this translation helpful? Give feedback.
-
I agree it'd be nice to have some built-in facilities for photo galleries. I played with lightgalleryjs at some point and it seemed promising, but there was a small glitch and I haven't revisited the topic since. For the time being I'm using R scripts to generate a list of photos (and Quarto files from a template, in fact), the lightbox plugin, and CSS grid/columns for the layout: photo galleries. I explained a few steps here, mostly for my future self: blog post I couldn't get the Flickity javascript to play nicely with lightbox so the slideshows can't be expanded to full screen. |
Beta Was this translation helpful? Give feedback.
-
I played a little bit to display some EXIF information at the description. https://github.com/rfsaldanha/rfsaldanha.github.io/blob/main/photos/photos.qmd |
Beta Was this translation helpful? Give feedback.
-
Now that
However, it would still be really great to have
or even build on the existing
|
Beta Was this translation helpful? Give feedback.
-
Here is a simple gallery with no external dependencies. https://github.com/mcanouil/quarto-issues-experiments/tree/main/test-quarto-gallery
gallery.mov |
Beta Was this translation helpful? Give feedback.
-
@mcanouil I completely understand. I'm currently adding all my css styling and extensions to your example step-by-step to see at which point it breaks so I can narrow down the cause and possibly provide an example that breaks it. I'll try to come back with a concrete broke example if I can figure out what is breaking the gallery in my website. |
Beta Was this translation helpful? Give feedback.
-
Continuing on my journey with photo galleries, I've recently found natural-gallery-js, which I really like: masonry, lazy load, and lightbox. I've updated my tea collection, unfortunately I haven't yet succeeded in embedding the right css/js bits and pieces into a qmd file, so this is currently a standalone html page inserted as an iframe. I'm using a R script to generate the json file where all the photos' info (width, height, as well as caption etc. from Lightroom) are stored and used to set up the masonry layout, captions, etc. The columns layout I had before was simpler and better integrated with quarto, but it did not have lazy loading and with ~300 images on the page, it was a bit of a mess as the columns reflowed while loading all images at the start. |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to order images by creation date or name? @mcanouil |
Beta Was this translation helpful? Give feedback.
-
Description
Hi Quarto folks! I'd like to know if there's a straightforward way to make photo galleries in Quarto websites? It's a common feature in blogs and supported by most major website platforms (Squarespace, Wordpress, etc), but I can't find any information on how to do it in Quarto. To be specific, I'm talking about these things (note the navigation arrows on either side of the photo):
(From this blog)
I saw there was one discussion on here about enabling lightbox style galleries, but it included a lot of custom CSS, Javascript, etc. Fingers crossed there's an easier solution. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions