Skip to content

Commit 355da51

Browse files
committed
refactor: update best practices to support any file extension
Signed-off-by: Adam Setch <[email protected]>
1 parent 4d69360 commit 355da51

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/memes/memes.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,34 @@ import type { BestPractice } from '~/types';
33
export const bestPractices: BestPractice[] = [
44
{
55
title: 'Before Coding',
6-
meme: 'distracted-boyfriend.jpg',
6+
meme: 'distracted-boyfriend',
7+
ext: 'jpg',
78
caption:
89
'Developer looking at "New Feature" while ignoring "Existing Bugs"',
910
},
1011
{
1112
title: 'Pull Request Feedback',
12-
meme: 'drake-hotline-bling.jpg',
13+
meme: 'drake-hotline-bling',
14+
ext: 'jpg',
1315
caption:
1416
'Drake rejecting "Messy Code" and approving "Clean, Refactored Code"',
1517
},
1618
{
1719
title: 'Daily Stand-up',
18-
meme: 'hide-the-pain-harold.jpg',
20+
meme: 'hide-the-pain-harold',
21+
ext: 'jpg',
1922
caption: '"Finally fixed that bug!"',
2023
},
2124
{
2225
title: 'Retrospective',
23-
meme: 'sus-fry.jpg',
26+
meme: 'sus-fry',
27+
ext: 'jpg',
2428
caption: '"Carrying over stories for the third sprint in a row"',
2529
},
2630
{
2731
title: 'Sprint Review',
28-
meme: 'one-does-not-simply.jpg',
32+
meme: 'one-does-not-simply',
33+
ext: 'jpg',
2934
caption: 'Discussing "what is a story point" for the tenth time this month',
3035
},
3136
];

src/sections/best-practices.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { bestPractices } from "~/memes/memes";
1919
class="w-full h-64 object-cover rounded-lg shadow-lg mb-2"
2020
width="500"
2121
height="400"
22-
src={import(`../memes/${item.meme}`)}
22+
src={import(`../memes/${item.meme}.${item.ext}`)}
2323
alt={item.title}
2424
/>
2525
<div class="text-xs italic mt-1">{item.caption}</div>

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface IconDetails {
1313
export interface BestPractice {
1414
title: string;
1515
meme: string;
16+
ext: 'jpg' | 'png' | 'svg';
1617
caption: string;
1718
}
1819

0 commit comments

Comments
 (0)