-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use explicit page instead of rewrite
- Loading branch information
1 parent
a1a32e7
commit 4cce62c
Showing
2 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { getPost, PostFull } from "../lib/getPosts"; | ||
import markdownToHtml from "../lib/markdownToHtml"; | ||
import { MainFooter } from "../components/MainFooter"; | ||
import { PostBody } from "../components/PostBody"; | ||
import { SharedHead } from "../components/SharedHead"; | ||
import { PostHeader } from "../components/PostHeader"; | ||
import { SharedNav } from "../components/SharedNav"; | ||
|
||
export default function AI(props: { post: PostFull }) { | ||
return ( | ||
<div> | ||
<SharedHead title={props.post.title} /> | ||
<SharedNav /> | ||
<div className="container w-full md:max-w-3xl mx-auto pt-12 pb-28 min-h-screen"> | ||
<article className="max-w space-y-12 px-4"> | ||
<PostHeader post={props.post} /> | ||
<PostBody post={props.post} /> | ||
</article> | ||
</div> | ||
<div className="w-full h-24 bg-gray-100 justify-center"> | ||
<div className="h-full w-full md:max-w-3xl mx-auto px-4"> | ||
<MainFooter /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export async function getStaticProps() { | ||
const post = getPost("2024-ai-manifesto"); | ||
const content = await markdownToHtml(post.content || ""); | ||
|
||
return { | ||
props: { | ||
post: { | ||
...post, | ||
content, | ||
}, | ||
}, | ||
}; | ||
} |