Skip to content

Commit 77a8629

Browse files
committed
Fixed the visible 'Galerry' header on pages without images
1 parent 40e95aa commit 77a8629

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

web/src/components/PreviewImages.astro

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,24 @@ if (images?.length) {
2929
---
3030

3131
{images?.length > 0 && (
32-
<div class="preview-images">
33-
{images.map(({ src, description, resolvedPath, width, height }) => (
34-
<a href={src} class="glightbox" data-description={description} data-gallery="gallery">
35-
<Image
36-
width={width}
37-
height={height}
38-
src={resolvedPath}
39-
alt={description || "Preview"}
40-
loading="lazy"
41-
decoding="async"
42-
/>
43-
</a>
44-
))}
32+
<div id="preview-images-gallery">
33+
<h4>Gallery</h4>
34+
<p>Click on the image to view the full preview along with the description.</p>
35+
36+
<div class="preview-images">
37+
{images.map(({ src, description, resolvedPath, width, height }) => (
38+
<a href={src} class="glightbox" data-description={description} data-gallery="gallery">
39+
<Image
40+
width={width}
41+
height={height}
42+
src={resolvedPath}
43+
alt={description || "Preview"}
44+
loading="lazy"
45+
decoding="async"
46+
/>
47+
</a>
48+
))}
49+
</div>
4550
</div>
4651
)}
4752

web/src/pages/reference/[func].astro

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,9 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data);
206206
<CodeExamplesSection codeExamples={funcExamples}, examplesRequired={true} theItem={func} />
207207

208208
<!-- Preview Images -->
209-
<div id="preview-images-gallery">
210-
<h4>Gallery</h4>
211-
<p>Click on the image to view the full preview along with the description.</p>
212-
<PreviewImages images={funcInfo.preview_images} />
213-
</div>
214-
209+
<PreviewImages images={funcInfo.preview_images} />
210+
211+
<!-- Changelog -->
215212
<ChangelogList entries={changelogEntries} />
216213

217214
<SeeAlsoSection seeAlsoLinks={getSeeAlsoLinksForItem(func)} currentId={func.id} />

0 commit comments

Comments
 (0)