Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #15

Merged
merged 2 commits into from
Oct 22, 2023
Merged

Dev #15

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ description: 'A detailed explanation on netmask, IP4, IPV6, and how we keep shif
banner: 'nilaysharan/blog/netmask/bannerr'
tags: 'tech,network'
---

Empty file.
Empty file.
11 changes: 11 additions & 0 deletions public/contents/projects/humantd.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: 'HumanTD'
slug: humantd
publishedAt: '2023-06-08'
description: 'Portal that tracks down a person of interest by using backtracking and video footage from CCTV cameras.'
banner: 'nilaysharan/project/humantd/qwlr8aaqfn7xwb1dazqr'
tags: 'react,tailwindcss,typescript'
github: 'github.com/nilaysharan/humantd'
---

sabdakbsdj
Empty file.
Empty file.
3 changes: 1 addition & 2 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ const Page = () => {
I find great joy in learning from feedback and criticism, so
please feel free to reach out to me. I also enjoy occasional
writing and creating unconventional projects, both of which
you can find featured here. Thank you for visiting, and I hope
you enjoy it!
you can find featured here.
</p>
<br />
<p data-fade='5'>
Expand Down
3 changes: 2 additions & 1 deletion src/app/api/blog/[slug]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export async function GET(req: NextRequest) {

try {
const preRoutes = preFetch({ type: 'blog' });
const preRoute = preRoutes.find((route) => route.slug === slug);
const preRoute = preRoutes?.find((route) => route.slug === slug);
if (!preRoute) return new NextResponse(null, { status: 404 });
const file = await getFileBySlug(
preRoute?.source as string,
preRoute?.slug as string
Expand Down
28 changes: 28 additions & 0 deletions src/app/api/projects/[slug]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { NextRequest, NextResponse } from 'next/server';

import { getFileBySlug, preFetch } from '@/lib/mdx.server';

export async function GET(req: NextRequest) {
const BASE_URL = `${req.nextUrl.origin}/api/projects/`;
const url = new URL(req.url || '', BASE_URL);

const slug = url.pathname.split('/').pop() || '';

if (!slug) return new NextResponse(null, { status: 404 });

try {
const preRoutes = preFetch({ type: 'projects' });
const preRoute = preRoutes?.find((route) => route.slug === slug);
const file = await getFileBySlug(
preRoute?.source as string,
preRoute?.slug as string
);

if (!file)
return new NextResponse(null, { status: 404, statusText: 'Not found ' });

return NextResponse.json(file);
} catch (error) {
return NextResponse.json({ error: error });
}
}
5 changes: 5 additions & 0 deletions src/app/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import BlogCard from '@/components/content/blogs/BlogCard';
import ContentPlaceholder from '@/components/content/ContenPlaceholder';
import StyledInput from '@/components/content/form/StyledInput';
import Tag, { SkipNavTag } from '@/components/content/Tag';
import Seo from '@/components/Seo';

import { BlogFrontmatter } from '@/types/frontmatters';

Expand Down Expand Up @@ -77,6 +78,10 @@ const Page = () => {

return (
<>
<Seo
templateTitle='Blog'
description='Thoughts, mental models, and tutorials about front-end development. Rebuild your mental model so front-end development can be predictable.'
/>
<main>
<section className={clsx(isLoaded && 'fade-in-start')}>
<div className='layout py-12'>
Expand Down
Loading
Loading