-
DescriptionDescriptionI am trying to create a gallery containing photos and videos using lightGallery library. Now, outside of Quarto, I am able to do so (just writing HTML and including the appropriate external stylesheets and scripts). However, when I try to copy-paste the gallery MWE that reproduces the error
project:
type: website
preview:
port: 5556
---
format:
html:
include-in-header:
- text: |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/justifiedGallery/3.8.1/css/justifiedGallery.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/css/lightgallery.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/css/lg-thumbnail.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/css/lg-zoom.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/css/lg-video.min.css">
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
include-after-body:
- text: |
<script src="https://cdnjs.cloudflare.com/ajax/libs/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/lightgallery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/plugins/thumbnail/lg-thumbnail.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/plugins/zoom/lg-zoom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/plugins/video/lg-video.min.js"></script>
<script>
$("#gallery-unfiled")
.justifiedGallery({
rowHeight: 200
})
.on("jg.complete", () => {
lightGallery(
document.getElementById("gallery-unfiled"),
{
plugins: [lgZoom, lgThumbnail, lgVideo],
}
);
});
</script>
---
```{=html}
<div id="gallery-unfiled">
<a data-video='{"source": [{"src":"video.mp4", "type":"video/mp4"}],
"attributes": {"preload": false, "controls": true}}'>
<img src="image.jpg" alt="">
</a>
</div>
``` Error thrown in the terminal
But the file is there! Software usedQuarto - v1.3.450 as well as 1.4.537 Note
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Did you inspect the output HTML? |
Beta Was this translation helpful? Give feedback.
This is helpful.
You are using a specific syntax that I don't think Quarto will parse to guess the resource that needs to be copied in website output.
So use the resource key to set it manually
https://quarto.org/docs/websites/website-tools.html#site-resources
For now the error is pretty clear: the video file is not available in your website project output (
_site
folder) - you could check it.