refactor: add layout to markdown posts

This commit is contained in:
Ruidy 2024-12-31 10:20:45 +01:00
parent f39b2715a2
commit 72dd16d023
No known key found for this signature in database
GPG key ID: E00F51288CB857CC
4 changed files with 11 additions and 5 deletions

View file

@ -0,0 +1,7 @@
---
const { frontmatter } = Astro.props
---
<h1>{frontmatter.title}</h1>
<p>Published on: {frontmatter.pubDate.toString()}</p>
<p>written by {frontmatter.author}</p>
<slot/>

View file

@ -1,7 +1,8 @@
---
layout: "../../layouts/BlogPostLayout.astro"
title: My first blog post
description: This is my first blog post
date: 2024-12-30
pubDate: 2024-12-30
author: Ruidy
image:
url: "https://docs.astro.build/assets/rose.webp"
@ -11,10 +12,6 @@ tags:
- blog
---
# My First Blog Post
Published on: 2022-07-01
Welcome to my _new blog_ about learning Astro! Here, I will share my learning journey
as I build a new website.

View file

@ -1,4 +1,5 @@
---
layout: "../../layouts/BlogPostLayout.astro"
title: My Second Blog Post
author: Astro Learner
description: "After learning some Astro, I couldn't stop!"

View file

@ -1,4 +1,5 @@
---
layout: "../../layouts/BlogPostLayout.astro"
title: My Third Blog Post
author: Astro Learner
description: "I had some challenges, but asking in the community really helped!"