Skip to content

Commit

Permalink
use explicit page instead of rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Jpoliachik committed Oct 27, 2024
1 parent a1a32e7 commit 4cce62c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
8 changes: 0 additions & 8 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ const nextConfig = {
return config;
},
trailingSlash: true,
async rewrites() {
return [
{
source: '/ai',
destination: '/posts/2024-ai-manifesto',
},
];
},
};

module.exports = nextConfig;
41 changes: 41 additions & 0 deletions pages/ai.tsx
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,
},
},
};
}

0 comments on commit 4cce62c

Please sign in to comment.