Skip to content

Commit 7fe1b48

Browse files
committed
Move sketch images to the api folder
1 parent d9323bc commit 7fe1b48

17 files changed

Lines changed: 3 additions & 3 deletions

docs/community_sketches.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Community sketches [from our curation](https://openprocessing.org/curation/87649
66

77
1. Add it to the curation on OpenProcessing
88
2. Take a screenshot of the sketch at a resolution of 1500x1000 as a `.png`
9-
3. Add it to `src/content/content/sketches/images`, naming it after the ID of the sketch (the numeric part of the OpenProcessing URL.)
9+
3. Add it to `src/api/images`, naming it after the ID of the sketch (the numeric part of the OpenProcessing URL.)
1010

1111
For example, the sketch https://openprocessing.org/sketch/2211029 would be saved as `2211029.png` in the folder.

src/api/OpenProcessing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export const makeThumbnailUrl = (id: string) =>
119119
`https://openprocessing-usercontent.s3.amazonaws.com/thumbnails/visualThumbnail${id}@2x.jpg`;
120120

121121
export const getSketchThumbnailSource = async (id: string) => {
122-
const manualThumbs = import.meta.glob<ImageMetadata>('../content/sketches/images/*', { import: 'default' })
123-
const key = `../content/sketches/images/${id}.png`;
122+
const manualThumbs = import.meta.glob<ImageMetadata>('./images/*', { import: 'default' })
123+
const key = `./images/${id}.png`;
124124
if (manualThumbs[key]) {
125125
const img = await manualThumbs[key]()
126126
return img;

0 commit comments

Comments
 (0)