Skip to content

Commit 36e305a

Browse files
authored
Merge pull request #24 from powdr-labs/reduce-banner-width
Reduce banner width
2 parents 7ca05ee + d278f49 commit 36e305a

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

data/blog/new-post-with-banner.mdx

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: 'My New Blog Post with Banner'
3+
date: '2023-04-15'
4+
lastmod: '2023-04-15'
5+
tags: ['blog', 'feature']
6+
draft: false
7+
summary: 'This is a sample blog post demonstrating the use of a banner image in the frontmatter.'
8+
images: ['/static/images/powdr-banner.png']
9+
layout: PostBanner
10+
---
11+
12+
# Welcome to My New Blog Post
13+
14+
This is a sample blog post that demonstrates the use of a banner image and the PostBanner layout. The banner image is specified in the frontmatter of this Markdown file.
15+
16+
## What's Different?
17+
18+
In the frontmatter of this post, we've added two important elements:
19+
20+
1. `images: ['/static/images/sample-banner.jpg']` - This specifies the banner image to be used.
21+
2. `layout: PostBanner` - This tells the blog to use the PostBanner layout for this post.
22+
23+
## Rest of the Post
24+
25+
The rest of your post content goes here. You can use all the Markdown features as usual, such as:
26+
27+
- Lists
28+
- **Bold text**
29+
- *Italic text*
30+
- [Links](https://example.com)
31+
- And more!
32+
33+
Remember to actually add the image file `sample-banner.jpg` to your `/static/images/` directory for this to work properly.

layouts/PostBanner.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ export default function PostMinimal({ content, next, prev, children }: LayoutPro
2929
<div>
3030
<div className="space-y-1 pb-10 text-center dark:border-gray-700">
3131
<div className="w-full">
32-
<Bleed>
33-
<div className="relative aspect-[2/1] w-full">
34-
<Image src={displayImage} alt={title} fill className="object-cover" />
35-
</div>
36-
</Bleed>
32+
<div className="relative mx-auto aspect-[2/1] w-full max-w-3xl">
33+
<Image src={displayImage} alt={title} fill className="object-cover" />
34+
</div>
3735
</div>
3836
<div className="relative pt-10">
3937
<PageTitle>{title}</PageTitle>

0 commit comments

Comments
 (0)