Skip to content

Commit 7eaac4a

Browse files
authored
Merge pull request #139 from Aryan-Techie/feature/blog-subtitle-support
feat: add blog subtitle support
2 parents cbf9da1 + 6e7b86e commit 7eaac4a

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/app/blog/[slug]/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ export default async function Blog({ params }: { params: Promise<{ slug: string
101101
{post.metadata.publishedAt && formatDate(post.metadata.publishedAt)}
102102
</Text>
103103
<Heading variant="display-strong-m">{post.metadata.title}</Heading>
104+
{post.metadata.subtitle && (
105+
<Text
106+
variant="body-default-l"
107+
onBackground="neutral-weak"
108+
align="center"
109+
style={{ fontStyle: 'italic' }}
110+
>
111+
{post.metadata.subtitle}
112+
</Text>
113+
)}
104114
</Column>
105115
<Row marginBottom="32" horizontal="center">
106116
<Row gap="16" vertical="center">

src/app/blog/posts/quick-start.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "Quick start with Magic Portfolio"
3+
subtitle: "A comprehensive guide to setting up your professional portfolio in minutes"
34
summary: "Magic Portfolio is a comprehensive, MDX-based, SEO-friendly, responsive portfolio template built with Once UI and Next.js."
45
image: "/images/gallery/horizontal-1.jpg"
56
publishedAt: "2025-04-23"

src/utils/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type Team = {
1111

1212
type Metadata = {
1313
title: string;
14+
subtitle?: string;
1415
publishedAt: string;
1516
summary: string;
1617
image?: string;
@@ -40,6 +41,7 @@ function readMDXFile(filePath: string) {
4041

4142
const metadata: Metadata = {
4243
title: data.title || "",
44+
subtitle: data.subtitle || "",
4345
publishedAt: data.publishedAt,
4446
summary: data.summary || "",
4547
image: data.image || "",

0 commit comments

Comments
 (0)