Skip to content

Commit

Permalink
Merge pull request #15 from SubstantialCattle5/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
SubstantialCattle5 authored Oct 22, 2023
2 parents 13d8190 + 5c6e493 commit ca92805
Show file tree
Hide file tree
Showing 16 changed files with 638 additions and 190 deletions.
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

0 comments on commit ca92805

Please sign in to comment.