Skip to content

Commit 51d665a

Browse files
committed
Fix build issue
1 parent c5db7c2 commit 51d665a

File tree

6 files changed

+576
-46
lines changed

6 files changed

+576
-46
lines changed
File renamed without changes.

components/BlogIndex.tsx

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import Link from "next/link";
2+
import type { Page } from "nextra";
3+
// eslint-disable-next-line import/no-unresolved
4+
import { getPagesUnderRoute } from "nextra/context";
5+
6+
export function BlogIndex() {
7+
return getPagesUnderRoute("/blog").map(
8+
(
9+
page: Page & {
10+
frontMatter?: {
11+
date?: string;
12+
description?: string;
13+
title?: string;
14+
};
15+
}
16+
) => {
17+
return (
18+
<div key={page.route} className="mb-10">
19+
<Link
20+
href={page.route}
21+
style={{ color: "inherit", textDecoration: "none" }}
22+
className="block font-semibold mt-8 text-2xl"
23+
>
24+
{page.meta?.title || page.frontMatter?.title || page.name}
25+
</Link>
26+
<p className="opacity-80" style={{ marginTop: ".5rem" }}>
27+
{page.frontMatter?.description}{" "}
28+
<span className="inline-block">
29+
<Link href={page.route}>{"Read more →"}</Link>
30+
</span>
31+
</p>
32+
{page.frontMatter?.date ? (
33+
<p className="opacity-50 text-sm">{page.frontMatter.date}</p>
34+
) : null}
35+
</div>
36+
);
37+
}
38+
);
39+
}

components/blog/BlogIndex.tsx

-28
This file was deleted.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"next": "^13.4.3",
13+
"nextra": "^2.10.0",
1314
"nextra-theme-docs": "^2.6.0",
1415
"react": "^18.2.0",
1516
"react-dom": "^18.2.0"

pages/blog.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ description: The latest updates and releases from the team at Allo.
33
type: posts
44
---
55

6-
import { BlogHeader } from "../components/blog/BlogHeader";
7-
import { BlogIndex } from "../components/blog/BlogIndex";
6+
import { BlogHeader } from "../components/BlogHeader";
7+
import { BlogIndex } from "../components/BlogIndex";
88

99
<BlogHeader />
1010
<BlogIndex />

0 commit comments

Comments
 (0)