- {items.map((item, index) => (
+ {items.map((item) => (
diff --git a/app/routes/blog.$slug.tsx b/app/routes/blog.$slug.tsx
index 975f423..34a02ee 100644
--- a/app/routes/blog.$slug.tsx
+++ b/app/routes/blog.$slug.tsx
@@ -1,5 +1,5 @@
import { defer, LoaderFunction, LoaderFunctionArgs } from "@remix-run/node";
-import { Await, useLoaderData } from "@remix-run/react";
+import { Await, useLoaderData, useParams } from "@remix-run/react";
import { NotionAPI } from "notion-client";
import React, { lazy, Suspense } from "react";
import { ClientOnly } from "remix-utils/client-only";
@@ -103,6 +103,8 @@ export const loader: LoaderFunction = async ({
export default function NotionRoute() {
const { recordMap } = useLoaderData
();
+ const { slug } = useParams();
+ const post = posts.find((p) => p.slug === slug);
return (
@@ -117,9 +119,12 @@ export default function NotionRoute() {
}
>
- {(resolvedRecordMap: ExtendedRecordMap) => (
-
- )}
+ {(resolvedRecordMap: ExtendedRecordMap) => {
+ if (post) {
+ document.title = post.title;
+ }
+ return ;
+ }}