From 5da0393628ef16705fe6b7eef7c79a1297acec2a Mon Sep 17 00:00:00 2001 From: ebby Date: Sun, 21 Jun 2026 19:12:15 +0200 Subject: [PATCH] bloglayout --- src/components/BackNav.astro | 15 ++++++++ src/components/PostPreviewLarge.astro | 5 +-- src/components/PostPreviewSmall.astro | 8 +--- src/layouts/BlogPostLayout.astro | 53 +++++++++++++++++++++++++-- src/layouts/Main.astro | 1 - src/pages/posts/120626_Test2.md | 21 ++++++++++- src/styles/global.css | 11 +++++- 7 files changed, 98 insertions(+), 16 deletions(-) create mode 100644 src/components/BackNav.astro diff --git a/src/components/BackNav.astro b/src/components/BackNav.astro new file mode 100644 index 0000000..bb93e33 --- /dev/null +++ b/src/components/BackNav.astro @@ -0,0 +1,15 @@ +--- + +--- + + + + + + diff --git a/src/components/PostPreviewLarge.astro b/src/components/PostPreviewLarge.astro index d4d5c47..96917a4 100644 --- a/src/components/PostPreviewLarge.astro +++ b/src/components/PostPreviewLarge.astro @@ -14,7 +14,7 @@ const img = findImageByPath(post.image.path);
-
+
{post.image.alt}
@@ -22,7 +22,7 @@ const img = findImageByPath(post.image.path); {post.subtitle}

{post.description}

- Author: {post.author} + Autor: {post.author} {post.date}
@@ -65,7 +65,6 @@ const img = findImageByPath(post.image.path); height: 100%; object-fit: cover; object-position: center; - border-radius: 8px; } .bottom-info { diff --git a/src/components/PostPreviewSmall.astro b/src/components/PostPreviewSmall.astro index 03a7917..fafcfc8 100644 --- a/src/components/PostPreviewSmall.astro +++ b/src/components/PostPreviewSmall.astro @@ -14,8 +14,8 @@ const img = findImageByPath(post.image.path) ---
-
- {post.image.alt} +
+ {post.image.alt}

{post.title}

{post.subtitle}

{post.description}

@@ -33,16 +33,12 @@ const img = findImageByPath(post.image.path) display: flex; flex-direction: column; border: 1px solid black; - border-radius: 8px; width: 240px; height: 100%; } img { max-height: 220px; - width: 220px; - border-radius: 8px; - aspect-ratio: 1 / 1; } .bottom-info { diff --git a/src/layouts/BlogPostLayout.astro b/src/layouts/BlogPostLayout.astro index cfeab70..acee608 100644 --- a/src/layouts/BlogPostLayout.astro +++ b/src/layouts/BlogPostLayout.astro @@ -1,9 +1,56 @@ --- +import BackNav from "../components/BackNav.astro"; +import { findImageByPath } from "../lib/findImage"; +import type { Post } from "../types/global"; import Main from "./Main.astro"; +interface Props { + frontmatter: Post; +} + const { frontmatter } = Astro.props; + +const titleImg = findImageByPath(frontmatter.image.path); --- -
- -
\ No newline at end of file +
+
+ {frontmatter.image.alt} +

{frontmatter.title}

+ {frontmatter.subtitle} +
+
+ Autor: {frontmatter.author} + {frontmatter.date} +
+
+ +
+ +
+ + diff --git a/src/layouts/Main.astro b/src/layouts/Main.astro index 3054495..72dc4d3 100644 --- a/src/layouts/Main.astro +++ b/src/layouts/Main.astro @@ -18,7 +18,6 @@ const { title } = Astro.props;
-

{title}