Compare commits

5 Commits

Author SHA1 Message Date
421394a794 Add dev:build script
All checks were successful
continuous-integration/drone/push Build is passing
2024-05-19 08:50:33 +02:00
a8362fa88f Add alt attribute to imgs 2024-05-19 08:50:00 +02:00
467b4bb0ad Fix typo & remove back button 2024-05-19 08:49:23 +02:00
7234cef7e1 Logo is home link 2024-05-19 08:48:18 +02:00
7ba1f78721 Add astro port to astro.config 2024-05-19 08:24:00 +02:00
9 changed files with 21 additions and 21 deletions

View File

@ -9,6 +9,9 @@ export default defineConfig({
build: {
inlineStylesheets: "auto",
},
server: {
port: 3000
},
integrations: [
tailwind({
config: {

View File

@ -6,11 +6,11 @@ const { content } = Astro.props;
const contentArray = getContentArray(content);
---
<div>
<article>
{
contentArray.map((value) => {
if (typeof value === "string") {
return <article set:html={value} />;
return <section set:html={value} />;
} else {
return (
<Image
@ -18,10 +18,10 @@ const contentArray = getContentArray(content);
width={value.width}
height={value.height}
format="webp"
alt="hallo"
alt={value.alt}
/>
);
}
})
}
</div>
</article>

View File

@ -1,9 +1,5 @@
---
const links = [
{
label: "Home",
link: "/home"
},
{
label: "About",
link: "/about"
@ -22,9 +18,11 @@ const links = [
<header class="flex justify-between py-6">
<div>
<span class="font-extrabold">
Logo
</span>
<a href="/">
<span class="font-extrabold">
Logo
</span>
</a>
</div>
<nav>
<ul class="flex gap-4 font-bold">

View File

@ -42,4 +42,4 @@ const posts = await getPosts();
}
</div>
</main>
</CLayout>
</ContentLayout>

View File

@ -20,11 +20,10 @@ const post = id && (await getPost(id));
post ? (
<ContentLayout title={`Paystro | ${post.title!}`}>
<div class="space-y-3 my-3">
<a href="/">BACK</a>
<h1 class="font-bold text-5xl">{post.title}</h1>
{post.content && <Content content={post.content} />}
</div>
</CLayout>
</ContentLayout>
) : (
<div>404</div>
)

View File

@ -12,12 +12,13 @@ export const getContentArray = (content: any) => {
src: node.value.filename,
width: `${node.value.width}`,
height: `${node.value.height}`,
alt: `${node.value.alt}`,
}),
},
}).replaceAll("<p></p>", "<p>&nbsp;</p>");
const htmlImageArray: (
| string
| { src: string; width: number; height: number }
| { src: string; width: number; height: number, alt: string }
)[] = [];
let lastIndex = 0;
while (true) {

View File

@ -5,6 +5,7 @@
"version": "1.2",
"scripts": {
"dev": "docker compose up",
"stop": "docker compose down"
"stop": "docker compose down",
"dev:build": "docker compose up --build"
}
}

View File

@ -18,6 +18,7 @@ export const Media: CollectionConfig = {
{
name: "alt",
type: "text",
required: true
},
],
};

View File

@ -38,10 +38,7 @@ const Posts: CollectionConfig = {
{
name: "title",
type: "text",
},
{
name: "hallo",
type: "text",
required: true
},
{
name: "publishedDate",
@ -59,7 +56,7 @@ const Posts: CollectionConfig = {
media: {
fields: [
{
name: "imagel",
name: "image",
type: "upload",
relationTo: "media",
required: true,