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 { Image } from "@astrojs/image/components";
|
||||||
import { getContentArray } from "../utils/helpers";
|
import { getContentArray } from "../utils/helpers";
|
||||||
|
import { getImageSrc } from "../utils/payload";
|
||||||
const { content } = Astro.props;
|
const { content } = Astro.props;
|
||||||
const contentArray = getContentArray(content);
|
const contentArray = getContentArray(content);
|
||||||
---
|
---
|
||||||
@ -13,7 +14,7 @@ const contentArray = getContentArray(content);
|
|||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<Image
|
<Image
|
||||||
src={`http://payload:3001/media/${value.src}`}
|
src={getImageSrc(value.src)}
|
||||||
width={value.width}
|
width={value.width}
|
||||||
height={value.height}
|
height={value.height}
|
||||||
format="webp"
|
format="webp"
|
||||||
|
@ -9,3 +9,5 @@ export const getPosts = async () =>
|
|||||||
|
|
||||||
export const getPost = async (id: string) =>
|
export const getPost = async (id: string) =>
|
||||||
(await (await fetch(`${url}/api/posts/${id}`)).json()) as Post;
|
(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