diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 6e08062..f5a95e9 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -15,10 +15,10 @@ // Function to update category images with full URLs function updateCategoryImages(categories: Array<{ image?: { url: string } }>) { return categories.map((category) => { - const imageUrl = category.image?.url; + const imageUrl = category.image?.formats.small.url; if (imageUrl) { - const fullUrl = imageUrl.startsWith("http") ? imageUrl : `${PUBLIC_STRAPI_HOST}${imageUrl}`; + const fullUrl = `${PUBLIC_STRAPI_HOST}${imageUrl}`; return { ...category, image: { ...category.image, url: fullUrl } }; } diff --git a/src/routes/galerie/+page.svelte b/src/routes/galerie/+page.svelte index 091683d..9886ea6 100644 --- a/src/routes/galerie/+page.svelte +++ b/src/routes/galerie/+page.svelte @@ -4,20 +4,13 @@ import { PUBLIC_STRAPI_HOST } from "$env/static/public"; export let data: PageData; - - const allImages = data.images.map((image: any) => ({ - alt: image.alternativeText, - src: PUBLIC_STRAPI_HOST + image.url, - height: image.height, - width: image.width, - }));
- {#each allImages as image} + {#each data.images as image}
- {image.alt} + {image.alt}
{/each}