@@ -4,10 +4,16 @@ import Link from "next/link";
4import { useRouter } from "next/router";
4import { useRouter } from "next/router";
5import classnames from "classnames";
5import classnames from "classnames";
6import { join } from "path";
6import { join } from "path";
7−import { buildPageTree, getPage } from "../../lib/lib";
8+ buildPageTree,
12+} from "../../lib/lib";
8import Markdown from "../../components/Markdown";
13import Markdown from "../../components/Markdown";
9import ContentArea from "../../components/ContentArea";
14import ContentArea from "../../components/ContentArea";
10import Sidebar from "../../components/Sidebar";
15import Sidebar from "../../components/Sidebar";
16+import Pagination from "../../components/Pagination";
11import markdownStyles from "../../styles/markdown.module.css";
17import markdownStyles from "../../styles/markdown.module.css";
12import { decode } from "html-entities";
18import { decode } from "html-entities";
@@ -65,6 +71,8 @@ export default function UnderstandingLayout({
@@ -87,6 +95,36 @@ export default function UnderstandingLayout({
87 dangerouslySetInnerHTML={{ __html: decode(markdown) }}
95 dangerouslySetInnerHTML={{ __html: decode(markdown) }}
88 ></article>
96 ></article>
98+ <div className="flex justify-between mt-16">
99+ {previousPost === null ? (
100+ <div className={""} />
104+ title="Previous Post"
108+ "understanding-urbit",
109+ params.slug?.slice(0, -1).join("/")
113+ {nextPost === null ? (
114+ <div className={""} />
122+ "understanding-urbit",
123+ params.slug?.slice(0, -1).join("/")
90 </ContentArea>
128 </ContentArea>
@@ -107,9 +145,25 @@ export async function getStaticProps({ params }) {
148+ const previousPost =
150+ params.slug?.slice(-1).join("") || "understanding-urbit",
151+ ["title", "slug", "weight"],
152+ join("understanding-urbit", params.slug?.slice(0, -1).join("/") || "/"),
158+ params.slug?.slice(-1).join("") || "understanding-urbit",
159+ ["title", "slug", "weight"],
160+ join("understanding-urbit", params.slug?.slice(0, -1).join("/") || "/"),
110 const markdown = await Markdown({ post: { content: content } });
164 const markdown = await Markdown({ post: { content: content } });
112− return { props: { posts, data, markdown, params } };
166+ return { props: { posts, data, markdown, params, previousPost, nextPost } };
115export async function getStaticPaths() {
169export async function getStaticPaths() {