Skip to content

Commit 8ee980d

Browse files
author
zhongyangxun
committed
feat: remove header image field from content schema
1 parent aac0b78 commit 8ee980d

6 files changed

Lines changed: 0 additions & 23 deletions

File tree

src/blog/post-1.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ title: 'My First Blog Post'
33
pubDate: 2022-07-01
44
description: 'This is the first post of my new Astro blog.'
55
author: 'Astro Learner'
6-
image:
7-
url: 'https://docs.astro.build/assets/rose.webp'
8-
alt: 'The Astro logo on a dark background with a pink glow.'
96
tags: ['astro', 'blogging', 'learning in public']
107
category: '技术实践'
118
---

src/blog/post-2.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
title: My Second Blog Post
33
author: Astro Learner
44
description: "After learning some Astro, I couldn't stop!"
5-
image:
6-
url: 'https://docs.astro.build/assets/arc.webp'
7-
alt: 'The Astro logo on a dark background with a purple gradient arc.'
85
pubDate: 2022-07-08
96
tags: ['astro', 'blogging', 'learning in public', 'successes']
107
category: '技术实践'

src/blog/post-3.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
title: My Third Blog Post
33
author: Astro Learner
44
description: 'I had some challenges, but asking in the community really helped!'
5-
image:
6-
url: 'https://docs.astro.build/assets/rays.webp'
7-
alt: 'The Astro logo on a dark background with rainbow rays.'
85
pubDate: 2022-07-15
96
tags: ['astro', 'learning in public', 'setbacks', 'community']
107
category: '技术实践'

src/blog/post-4.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
title: My Fourth Blog Post
33
author: Astro Learner
44
description: 'This post will show up on its own!'
5-
image:
6-
url: 'https://docs.astro.build/default-og-image.png'
7-
alt: 'The word astro against an illustration of planets and stars.'
85
pubDate: 2022-08-08
96
tags: ['astro', 'successes']
107
category: '技术实践'

src/content.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ const blog = defineCollection({
1010
update: z.date().optional(),
1111
description: z.string(),
1212
author: z.string(),
13-
image: z.object({
14-
url: z.string(),
15-
alt: z.string(),
16-
}),
1713
category: z.enum(['技术实践', '读书笔记', '碎片随笔', '工具推荐']),
1814
tags: z.array(z.string()),
1915
series: z.string().optional(),

src/layouts/PostLayout.astro

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
---
22
import Baselayout from './Baselayout.astro';
3-
4-
const { post } = Astro.props;
53
---
64

75
<Baselayout>
8-
<img
9-
src={post.data.image.url}
10-
alt={post.data.image.alt}
11-
class="w-full h-auto"
12-
/>
136
<slot />
147
</Baselayout>

0 commit comments

Comments
 (0)