From 6951aa51d051e47145af6fd60c07498383c56e7d Mon Sep 17 00:00:00 2001 From: ebby Date: Sat, 29 Aug 2026 10:45:37 +0200 Subject: [PATCH] Lesezeit added --- blog/src/components/PostPreviewLarge.astro | 2 ++ blog/src/components/PostPreviewSmall.astro | 1 + blog/src/content.config.ts | 1 + blog/src/pages/blog/1_Under_Construction.md | 1 + blog/src/pages/blog/2_Ostseeurlaub.md | 1 + blog/src/pages/blog/3_Matrei.md | 1 + blog/src/pages/index.astro | 2 -- 7 files changed, 7 insertions(+), 2 deletions(-) diff --git a/blog/src/components/PostPreviewLarge.astro b/blog/src/components/PostPreviewLarge.astro index 3ff1b33..dc876c3 100644 --- a/blog/src/components/PostPreviewLarge.astro +++ b/blog/src/components/PostPreviewLarge.astro @@ -29,6 +29,8 @@ const localeDate = formatLocalizedDateString(post.date) {localeDate} Autor: {post.author} + + Lesezeit: {post.time2read} min

{post.description}

diff --git a/blog/src/components/PostPreviewSmall.astro b/blog/src/components/PostPreviewSmall.astro index a99faab..7f8a62e 100644 --- a/blog/src/components/PostPreviewSmall.astro +++ b/blog/src/components/PostPreviewSmall.astro @@ -18,6 +18,7 @@ const localeDate = formatLocalizedDateString(post.date) {post.image.alt}

{post.title}

{post.subtitle} +

Lesezeit: {post.time2read} min

{post.description}

Author: {post.author} diff --git a/blog/src/content.config.ts b/blog/src/content.config.ts index 030b763..e51eecc 100644 --- a/blog/src/content.config.ts +++ b/blog/src/content.config.ts @@ -14,6 +14,7 @@ const postSchema = z.object({ author: z.string(), date: z.coerce.date(), slug: z.string(), + time2read: z.int() }); export type PostData = z.infer; diff --git a/blog/src/pages/blog/1_Under_Construction.md b/blog/src/pages/blog/1_Under_Construction.md index befd4fe..43b1fa9 100644 --- a/blog/src/pages/blog/1_Under_Construction.md +++ b/blog/src/pages/blog/1_Under_Construction.md @@ -9,6 +9,7 @@ image: author: Tim date: '2026-07-10' slug: Under-Construction +time2read: 1 --- # All Endings Are Beginnings diff --git a/blog/src/pages/blog/2_Ostseeurlaub.md b/blog/src/pages/blog/2_Ostseeurlaub.md index ebb0c07..e001a02 100644 --- a/blog/src/pages/blog/2_Ostseeurlaub.md +++ b/blog/src/pages/blog/2_Ostseeurlaub.md @@ -9,6 +9,7 @@ image: author: Tim date: '2026-08-20' slug: Ostseeurlaub +time2read: 6 --- Eigentlich soll es hier um unser (zukünftiges) Boot und die Segelreisen gehen. diff --git a/blog/src/pages/blog/3_Matrei.md b/blog/src/pages/blog/3_Matrei.md index 45759b8..31df84c 100644 --- a/blog/src/pages/blog/3_Matrei.md +++ b/blog/src/pages/blog/3_Matrei.md @@ -9,6 +9,7 @@ image: author: Tim date: '2026-08-29' slug: Luxusurlaub-in-Matrei +time2read: 14 --- Was könnte ein besser Kontrast zum Zelturlaub an der Ostsee sein, als eine Woche in einem luxuriösen Hotel, mitten in den Alpen?
diff --git a/blog/src/pages/index.astro b/blog/src/pages/index.astro index f69bc82..f10beb3 100644 --- a/blog/src/pages/index.astro +++ b/blog/src/pages/index.astro @@ -10,8 +10,6 @@ const allPostsSorted = (await getCollection('posts')).sort( ); const [mostRecentPost, ...sortedPosts] = allPostsSorted; - -console.log(mostRecentPost.data) ---