asdf
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
parent
b958e29288
commit
a3e58fecd6
@ -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 (
|
||||
<Image
|
||||
src={`http://payload:3001/media/${value.src}`}
|
||||
src={getImageSrc(value.src)}
|
||||
width={value.width}
|
||||
height={value.height}
|
||||
format="webp"
|
||||
|
@ -9,3 +9,5 @@ export const getPosts = async () =>
|
||||
|
||||
export const getPost = async (id: string) =>
|
||||
(await (await fetch(`${url}/api/posts/${id}`)).json()) as Post;
|
||||
|
||||
export const getImageSrc = (src: string) => `${url}/media/${src}}`;
|
||||
|
Loading…
Reference in New Issue
Block a user