From deac573d3036c728429dee53f5bde600d5970aaf Mon Sep 17 00:00:00 2001 From: June Date: Mon, 17 Nov 2025 15:16:37 +1300 Subject: [PATCH] Use relative paths for images --- web/src/pages/index.astro | 2 +- web/src/pages/recipe/[id].astro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/pages/index.astro b/web/src/pages/index.astro index 4dcad1f..9008b23 100644 --- a/web/src/pages/index.astro +++ b/web/src/pages/index.astro @@ -11,7 +11,7 @@ const records = await pb.collection('recipes').getFullList() const recipes = records.map(r => new Recipe(r.cooklang)) const ids = records.map(r => r.id) const images = await Promise.all( - records.map(r => pb.files.getURL(r, r.images[0])) // get first image from each recipe as a cover image + records.map(r => pb.files.getURL(r, r.images[0]).substring(21)) // get first image from each recipe as a cover image ) --- diff --git a/web/src/pages/recipe/[id].astro b/web/src/pages/recipe/[id].astro index bc20368..576ad05 100644 --- a/web/src/pages/recipe/[id].astro +++ b/web/src/pages/recipe/[id].astro @@ -16,7 +16,7 @@ const re = await pb.collection('recipes').getOne(id as string) let recipeData = new Recipe(re.cooklang) const images = await Promise.all( - re.images.map(r => pb.files.getURL(re, r)) + re.images.map(r => pb.files.getURL(re, r).substring(21)) ) ---