mirror of
https://github.com/urbit/developers.urbit.org.git
synced 2024-09-21 02:38:02 +03:00
34 lines
761 B
JavaScript
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 },
|
|
};
|
|
}
|