+ {entries
+ .map((e) => (
+
);
}
diff --git a/src/pages/[[...path]].jsx b/src/pages/[[...path]].jsx
index 4538a1a..a4e3b8e 100644
--- a/src/pages/[[...path]].jsx
+++ b/src/pages/[[...path]].jsx
@@ -11,7 +11,6 @@ import { NextSeo } from "next-seo";
export async function getServerSideProps({ params }) {
const { path } = params;
- console.log(params);
const res = await fetchBasicPages([], {
path: {
_eq: path?.join("/") ?? null,
diff --git a/src/pages/library/index.js b/src/pages/library/index.js
index 67ba7fb..e8f1c70 100644
--- a/src/pages/library/index.js
+++ b/src/pages/library/index.js
@@ -16,7 +16,7 @@ export async function getServerSideProps() {
}
const reviews = (await res.json()).data.sort(
- (a, b) => new Date(b.read_date).getTime() - new Date(a.read_date).getTime(),
+ (a, b) => new Date(b.readDate).getTime() - new Date(a.readDate).getTime(),
);
return {
diff --git a/src/pages/writing/[slug].js b/src/pages/writing/[slug].js
index 6e1817f..1133fea 100644
--- a/src/pages/writing/[slug].js
+++ b/src/pages/writing/[slug].js
@@ -4,27 +4,6 @@ import Article from "@/components/Article/Article";
import { fetchPosts, markdownToHtml } from "@/services/content-service";
import { FailedFetchPostError, FailedFetchPostsError } from "@/errors";
-// export async function getStaticPaths () {
-// const res = await fetchPosts(['slug'], {
-// status: 'published'
-// })
-
-// if (!res.ok) {
-// throw new FailedFetchPostsError(await res.text())
-// }
-
-// const posts = (await res.json()).data
-
-// return {
-// paths: posts.map(post => ({
-// params: {
-// slug: post.slug
-// }
-// })),
-// fallback: true // false or "blocking"
-// }
-// }
-
export const getServerSideProps = async ({ params }) => {
const { slug } = params;
const res = await fetchPosts([], {
diff --git a/src/pages/writing/index.js b/src/pages/writing/index.js
index 50fcdce..01b05b1 100644
--- a/src/pages/writing/index.js
+++ b/src/pages/writing/index.js
@@ -15,6 +15,7 @@ export const getServerSideProps = async () => {
}
const json = await res.json();
+
const posts = json.data.sort(
(a, b) =>
new Date(b.datePublished).getTime() - new Date(a.datePublished).getTime(),
+ {e.title}{" "} + {!!e.datePublished && {`on ${formatDate(e.datePublished)}`}} +
+ )) + .slice(0, max > 0 ? max : entries.length)} +