Skip to content

Commit 66116b0

Browse files
committed
apply index card basePaths only to frontmatter, not default placeholder ones that are impoted through webpack instead
1 parent 273f20f commit 66116b0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

packages/theme/components/layout/index-cards/IndexCards.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,16 @@ export function IndexCards({route, folderData}: IndexCardsProps) {
8888

8989
const thumbnailUrl =
9090
colorMode === 'dark'
91-
? item.frontMatter.thumbnail_darkMode || getNextPlaceholderIndex(darkModePlaceholderThumbs).src
92-
: item.frontMatter.thumbnail || getNextPlaceholderIndex(lightModePlaceholderThumbs).src
91+
? `${basePath ? basePath : ''}${item.frontMatter.thumbnail_darkMode}` ||
92+
getNextPlaceholderIndex(darkModePlaceholderThumbs).src
93+
: `${basePath ? basePath : ''}${item.frontMatter.thumbnail}` ||
94+
getNextPlaceholderIndex(lightModePlaceholderThumbs).src
9395

9496
return (
9597
<Grid.Column span={{xsmall: 12, small: 12, medium: 12, large: 6, xlarge: 4}} key={item.frontMatter.title}>
9698
<Link legacyBehavior passHref href={item.route}>
9799
<Card href="#" hasBorder>
98-
<Card.Image src={`${basePath ? basePath : ''}${thumbnailUrl}`} alt="" aspectRatio="4:3" />
100+
<Card.Image src={thumbnailUrl} alt="" aspectRatio="4:3" />
99101
<Card.Heading>{item.frontMatter.title}</Card.Heading>
100102
{item.frontMatter.description && <Card.Description>{item.frontMatter.description}</Card.Description>}
101103
</Card>

0 commit comments

Comments
 (0)