mirror of
https://github.com/rjNemo/orbital-orbit
synced 2026-06-06 06:56:40 +00:00
refactor: add layout to markdown posts
This commit is contained in:
parent
f39b2715a2
commit
72dd16d023
4 changed files with 11 additions and 5 deletions
7
src/layouts/BlogPostLayout.astro
Normal file
7
src/layouts/BlogPostLayout.astro
Normal 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/>
|
||||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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!"
|
||||
|
|
|
|||
|
|
@ -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!"
|
||||
|
|
|
|||
Loading…
Reference in a new issue