-
-
- {post.entry.title}
-
-
- {post.entry.description}
-
-
+
Posts
+
+ {sortedPostsData.map((post) => (
+ -
+
+
+
+
+
+ {post.entry.title}
+
+
+ {post.entry.description}
+
-
-
- ))}
-
-
- >
+
+
+
+ ))}
+
+
);
};
diff --git a/src/components/homepage/About.tsx b/src/components/homepage/About.tsx
new file mode 100644
index 0000000..19a23a5
--- /dev/null
+++ b/src/components/homepage/About.tsx
@@ -0,0 +1,29 @@
+import config from "../../../keystatic.config";
+import { createReader } from "@keystatic/core/reader";
+import { DocumentRenderer } from "@keystatic/core/renderer";
+
+const reader = createReader(process.cwd(), config);
+
+const About = async () => {
+ const aboutData = await reader.singletons.about.read({
+ resolveLinkedFiles: true,
+ });
+
+ return (
+
+
+ About
+
+
+ {aboutData && aboutData.description && (
+
+
+
+ )}
+
+ );
+};
+
+export default About;
diff --git a/src/components/homepage/Experiences.tsx b/src/components/homepage/Experiences.tsx
new file mode 100644
index 0000000..63e1f23
--- /dev/null
+++ b/src/components/homepage/Experiences.tsx
@@ -0,0 +1,84 @@
+import config from "../../../keystatic.config";
+import { Badge } from "@/components/ui/Badge";
+import { LinkTag } from "@/components/ui/typography/LinkTag";
+import { linkedInProfile } from "@/lib/constants";
+import { formatDateRange } from "@/lib/dates";
+import { createReader } from "@keystatic/core/reader";
+import dayjs from "dayjs";
+import { TbExternalLink } from "react-icons/tb";
+
+const reader = createReader(process.cwd(), config);
+
+const Experiences = async () => {
+ const experiencesData = await reader.collections.experiences.all();
+
+ const sortedExperiencesDataByDate = experiencesData.sort((a, b) =>
+ dayjs(b.entry.startDate).diff(dayjs(a.entry.startDate))
+ );
+
+ return (
+
+ );
+};
+
+export default Experiences;
diff --git a/src/components/homepage/Posts.tsx b/src/components/homepage/Posts.tsx
new file mode 100644
index 0000000..a01c53e
--- /dev/null
+++ b/src/components/homepage/Posts.tsx
@@ -0,0 +1,59 @@
+import Link from "next/link";
+import config from "../../../keystatic.config";
+import { createReader } from "@keystatic/core/reader";
+import dayjs from "dayjs";
+
+const reader = createReader(process.cwd(), config);
+
+const Posts = async () => {
+ const postsData = await reader.collections.posts.all();
+
+ const sortedPostsData = postsData.sort((a, b) =>
+ dayjs(b.entry.date).diff(dayjs(a.entry.date))
+ );
+
+ const firstThreePosts = sortedPostsData.slice(0, 3);
+
+ return (
+
+
+ Posts
+
+
+ {firstThreePosts.map((post) => (
+ -
+
+
+
+
+
+ {post.entry.title}
+
+
+ {post.entry.description}
+
+
+
+
+
+ ))}
+
+
+
+
+ More Posts
+
+
+
+ );
+};
+
+export default Posts;
diff --git a/src/components/homepage/Projects.tsx b/src/components/homepage/Projects.tsx
new file mode 100644
index 0000000..e454e02
--- /dev/null
+++ b/src/components/homepage/Projects.tsx
@@ -0,0 +1,56 @@
+import config from "../../../keystatic.config";
+import CoverImage from "@/components/CoverImage";
+import { createReader } from "@keystatic/core/reader";
+
+const reader = createReader(process.cwd(), config);
+
+const Projects = async () => {
+ const projectsData = await reader.collections.projects.all();
+
+ return (
+
+ );
+};
+
+export default Projects;