diff --git a/astro/src/components/Content.astro b/astro/src/components/Content.astro index d54e1a5..14b3f46 100644 --- a/astro/src/components/Content.astro +++ b/astro/src/components/Content.astro @@ -1,6 +1,7 @@ --- import { Image } from "@astrojs/image/components"; import { getContentArray } from "../utils/helpers"; +import { getImageSrc } from "../utils/payload"; const { content } = Astro.props; const contentArray = getContentArray(content); --- @@ -13,7 +14,7 @@ const contentArray = getContentArray(content); } else { return ( export const getPost = async (id: string) => (await (await fetch(`${url}/api/posts/${id}`)).json()) as Post; + +export const getImageSrc = (src: string) => `${url}/media/${src}}`;