developers.urbit.org/pages/community/opportunities.js
2022-10-05 15:54:24 -07:00

34 lines
761 B
JavaScript

import BasicPage from "../../components/BasicPage";
import { Markdown, getPostBySlug } from "@urbit/foundation-design-system";
export default function Post({ post, markdown, search, index }) {
return (
<BasicPage
wide
post={post}
markdown={markdown}
search={search}
index={index}
/>
);
}
export async function getStaticProps({ params }) {
const post = getPostBySlug(
"opportunities",
["title", "slug", "content", "extra"],
"community"
);
let { index } = post?.extra || { index: null };
if (index === undefined) {
index = null;
}
const markdown = JSON.stringify(Markdown.parse({ post: { content: String.raw`${post.content}` } }));
return {
props: { post, markdown, index },
};
}