diff --git a/src/lib/components/heroPost.svelte b/src/lib/components/heroPost.svelte
index f09ec09..1b5b8b3 100644
--- a/src/lib/components/heroPost.svelte
+++ b/src/lib/components/heroPost.svelte
@@ -1,15 +1,16 @@
-
-
+
+
{#each categories as category}
@@ -20,19 +21,22 @@
{description}
- —
+
—
{author}
- —
-
{date}
+
—
+
{relDate}
-
+
\ No newline at end of file
diff --git a/src/lib/components/navbar.svelte b/src/lib/components/navbar.svelte
new file mode 100644
index 0000000..b28d98e
--- /dev/null
+++ b/src/lib/components/navbar.svelte
@@ -0,0 +1,20 @@
+
+
+
\ No newline at end of file
diff --git a/src/lib/components/post.svelte b/src/lib/components/post.svelte
index 5d660c5..5dfbb14 100644
--- a/src/lib/components/post.svelte
+++ b/src/lib/components/post.svelte
@@ -6,6 +6,7 @@
export var title;
export var authorIcon;
export var currentHover;
+ export var path;
var grayscale = false;
$: grayscale = currentHover && currentHover !== title;
@@ -18,8 +19,8 @@
}
-
+
\ No newline at end of file
diff --git a/src/lib/stores/darkmode.js b/src/lib/stores/darkmode.js
index 8a817ce..a0c46dc 100644
--- a/src/lib/stores/darkmode.js
+++ b/src/lib/stores/darkmode.js
@@ -8,6 +8,15 @@ const darkmode = writable(
darkmode.subscribe(v => {
if(typeof window !== "undefined")
localStorage.setItem("darkmode", JSON.stringify(v));
+
+
+ if(typeof document !== "undefined") {
+ if(v) {
+ document.body.classList.add("dark");
+ } else {
+ document.body.classList.remove("dark");
+ }
+ }
});
export default darkmode;
\ No newline at end of file
diff --git a/src/routes/api/posts.json.js b/src/routes/api/posts.json.js
new file mode 100644
index 0000000..9276680
--- /dev/null
+++ b/src/routes/api/posts.json.js
@@ -0,0 +1,27 @@
+import { DateTime } from "luxon";
+
+export async function get() {
+ const allPostFiles = import.meta.glob('../posts/*.md')
+ const iterablePostFiles = Object.entries(allPostFiles)
+
+ const allPosts = await Promise.all(
+ iterablePostFiles.map(async ([path, resolver]) => {
+ const { metadata } = await resolver()
+ const postPath = path.slice(2, -3)
+
+ return {
+ ...metadata,
+ relDate: DateTime.fromISO(metadata.date).toRelativeCalendar(),
+ path: postPath,
+ }
+ })
+ )
+
+ const sortedPosts = allPosts.sort((a, b) => {
+ return new Date(b.date) - new Date(a.date)
+ })
+
+ return {
+ body: sortedPosts
+ }
+}
\ No newline at end of file
diff --git a/src/routes/index.svelte b/src/routes/index.svelte
index cb197f5..5cb3c3d 100644
--- a/src/routes/index.svelte
+++ b/src/routes/index.svelte
@@ -1,32 +1,35 @@
+
+
@@ -34,14 +37,7 @@
-
-
- Daniel Bulant
-
- {$darkmode ? "Light" : "Dark"} mode
- Contact
-
-
+
I'm a young developer making appTypeHover = "websites"} on:mouseleave={() => appTypeHover == "websites" && (appTypeHover = null)}>websites ,
@@ -120,7 +116,7 @@
Rust
technologySelected = "x11"}>
-
+
X11
technologySelected = "cs"}>
@@ -140,15 +136,15 @@
React
technologySelected = "nomad"}>
-
+
Nomad
technologySelected = "consul"}>
-
+
Consul
technologySelected = "discord"}>
-
+
Discord
@@ -186,17 +182,19 @@
Linux
technologySelected = "nginx"}>
-
+
Nginx
technologySelected = "cloudflare"}>
-
+
Cloudflare