Skip to content

Commit 6f6d404

Browse files
committed
default thumbnail image
1 parent 2c102c5 commit 6f6d404

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

astropylibrarian/algolia/records.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ def from_section(
308308
kwargs[f"h{i + 1}"] = heading
309309
if tutorial.images:
310310
# TODO consider an explicitly set thumbnail from tutorial metadata
311-
kwargs["thumbnail_url"] = tutorial.images[0]
311+
# kwargs["thumbnail_url"] = tutorial.images[0] # with JupyterBook, this selects the sidebar logo
312+
kwargs["thumbnail_url"] = tutorial.images[-1]
312313

313314
return cls(**kwargs)
314315

@@ -352,7 +353,8 @@ def from_section(
352353
if page.image_urls:
353354
# TODO consider getting a thumbnail explicitly set form guide
354355
# metadata
355-
thumbnail_url: Optional[str] = page.image_urls[0]
356+
# thumbnail_url: Optional[str] = page.image_urls[0]
357+
thumbnail_url: Optional[str] = page.image_urls[-1]
356358
elif site_metadata.logo_url:
357359
thumbnail_url = site_metadata.logo_url
358360
else:

0 commit comments

Comments
 (0)