generated from autonomic-cooperative/astro-payload-template
Compare commits
5 Commits
da435c8fc1
...
421394a794
Author | SHA1 | Date | |
---|---|---|---|
421394a794 | |||
a8362fa88f | |||
467b4bb0ad | |||
7234cef7e1 | |||
7ba1f78721 |
@ -9,6 +9,9 @@ export default defineConfig({
|
|||||||
build: {
|
build: {
|
||||||
inlineStylesheets: "auto",
|
inlineStylesheets: "auto",
|
||||||
},
|
},
|
||||||
|
server: {
|
||||||
|
port: 3000
|
||||||
|
},
|
||||||
integrations: [
|
integrations: [
|
||||||
tailwind({
|
tailwind({
|
||||||
config: {
|
config: {
|
||||||
|
@ -6,11 +6,11 @@ const { content } = Astro.props;
|
|||||||
const contentArray = getContentArray(content);
|
const contentArray = getContentArray(content);
|
||||||
---
|
---
|
||||||
|
|
||||||
<div>
|
<article>
|
||||||
{
|
{
|
||||||
contentArray.map((value) => {
|
contentArray.map((value) => {
|
||||||
if (typeof value === "string") {
|
if (typeof value === "string") {
|
||||||
return <article set:html={value} />;
|
return <section set:html={value} />;
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<Image
|
<Image
|
||||||
@ -18,10 +18,10 @@ const contentArray = getContentArray(content);
|
|||||||
width={value.width}
|
width={value.width}
|
||||||
height={value.height}
|
height={value.height}
|
||||||
format="webp"
|
format="webp"
|
||||||
alt="hallo"
|
alt={value.alt}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</div>
|
</article>
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
---
|
---
|
||||||
const links = [
|
const links = [
|
||||||
{
|
|
||||||
label: "Home",
|
|
||||||
link: "/home"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "About",
|
label: "About",
|
||||||
link: "/about"
|
link: "/about"
|
||||||
@ -22,9 +18,11 @@ const links = [
|
|||||||
|
|
||||||
<header class="flex justify-between py-6">
|
<header class="flex justify-between py-6">
|
||||||
<div>
|
<div>
|
||||||
<span class="font-extrabold">
|
<a href="/">
|
||||||
Logo
|
<span class="font-extrabold">
|
||||||
</span>
|
Logo
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="flex gap-4 font-bold">
|
<ul class="flex gap-4 font-bold">
|
||||||
|
@ -42,4 +42,4 @@ const posts = await getPosts();
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</CLayout>
|
</ContentLayout>
|
||||||
|
@ -20,11 +20,10 @@ const post = id && (await getPost(id));
|
|||||||
post ? (
|
post ? (
|
||||||
<ContentLayout title={`Paystro | ${post.title!}`}>
|
<ContentLayout title={`Paystro | ${post.title!}`}>
|
||||||
<div class="space-y-3 my-3">
|
<div class="space-y-3 my-3">
|
||||||
<a href="/">BACK</a>
|
|
||||||
<h1 class="font-bold text-5xl">{post.title}</h1>
|
<h1 class="font-bold text-5xl">{post.title}</h1>
|
||||||
{post.content && <Content content={post.content} />}
|
{post.content && <Content content={post.content} />}
|
||||||
</div>
|
</div>
|
||||||
</CLayout>
|
</ContentLayout>
|
||||||
) : (
|
) : (
|
||||||
<div>404</div>
|
<div>404</div>
|
||||||
)
|
)
|
||||||
|
@ -12,12 +12,13 @@ export const getContentArray = (content: any) => {
|
|||||||
src: node.value.filename,
|
src: node.value.filename,
|
||||||
width: `${node.value.width}`,
|
width: `${node.value.width}`,
|
||||||
height: `${node.value.height}`,
|
height: `${node.value.height}`,
|
||||||
|
alt: `${node.value.alt}`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
}).replaceAll("<p></p>", "<p> </p>");
|
}).replaceAll("<p></p>", "<p> </p>");
|
||||||
const htmlImageArray: (
|
const htmlImageArray: (
|
||||||
| string
|
| string
|
||||||
| { src: string; width: number; height: number }
|
| { src: string; width: number; height: number, alt: string }
|
||||||
)[] = [];
|
)[] = [];
|
||||||
let lastIndex = 0;
|
let lastIndex = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
"version": "1.2",
|
"version": "1.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "docker compose up",
|
"dev": "docker compose up",
|
||||||
"stop": "docker compose down"
|
"stop": "docker compose down",
|
||||||
|
"dev:build": "docker compose up --build"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ export const Media: CollectionConfig = {
|
|||||||
{
|
{
|
||||||
name: "alt",
|
name: "alt",
|
||||||
type: "text",
|
type: "text",
|
||||||
|
required: true
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
@ -38,10 +38,7 @@ const Posts: CollectionConfig = {
|
|||||||
{
|
{
|
||||||
name: "title",
|
name: "title",
|
||||||
type: "text",
|
type: "text",
|
||||||
},
|
required: true
|
||||||
{
|
|
||||||
name: "hallo",
|
|
||||||
type: "text",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "publishedDate",
|
name: "publishedDate",
|
||||||
@ -59,7 +56,7 @@ const Posts: CollectionConfig = {
|
|||||||
media: {
|
media: {
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: "imagel",
|
name: "image",
|
||||||
type: "upload",
|
type: "upload",
|
||||||
relationTo: "media",
|
relationTo: "media",
|
||||||
required: true,
|
required: true,
|
||||||
|
Reference in New Issue
Block a user