Skip to content

Commit 2bdc8fe

Browse files
committed
404 page is added
1 parent 235db62 commit 2bdc8fe

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

src/lib/404.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export {
2+
getPosts,
3+
getAllCategories,
4+
getAllTags,
5+
getPostsByCategory,
6+
getPostsByTag,
7+
} from "./post";
8+
export {
9+
cn,
10+
slugify,
11+
formatDate,
12+
reformatDate,
13+
calculateReadingTime,
14+
sortItemsByDateDesc,
15+
} from "./utils";

src/pages/404.astro

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
import { getCollection } from "astro:content";
3+
import Header from "@/components/Header.astro";
4+
import { CONFIG } from "@/config";
5+
import BaseLayout from "@/layouts/BaseLayout.astro";
6+
import { reformatDate, sortItemsByDateDesc } from "@/lib";
7+
8+
const posts = (await getCollection("blog")).sort(sortItemsByDateDesc);
9+
const featuredBlogPosts = posts.filter(
10+
({ data }) => data.isFeatured,
11+
);
12+
const softSkillPosts = posts.filter(
13+
({ data }) => data.category === "soft-skill",
14+
);
15+
const conferenceTalkPosts = posts.filter(
16+
({ data }) => data.category === "conference-talks",
17+
);
18+
---
19+
20+
<BaseLayout description={CONFIG.meta.description}>
21+
<Header />
22+
<div class="flex flex-col space-y-6 md:space-y-12 pb-8 pt-4">
23+
<div class="flex flex-col md:px-6 animate-slide-from-down-and-fade-2">
24+
<div class="flex flex-col space-y-2">
25+
<span class="font-semibold">404</span>
26+
<span class="text-neutral-300/80 leading-6">
27+
It was working on my local but..
28+
</span>
29+
</div>
30+
</div>
31+
32+
<div class="flex flex-col space-y-6 md:space-y-12">
33+
34+
<a href="/"><img src="/public/images/various/404.png"></a>
35+
36+
</div>
37+
</div>
38+
</BaseLayout>

0 commit comments

Comments
 (0)