mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-05-01 03:09:34 +00:00
Added Blog Page and Housekeeping
This commit is contained in:
parent
db4bf103c3
commit
d32415232e
18 changed files with 6860 additions and 769 deletions
32
app/(main)/blog/page.tsx
Normal file
32
app/(main)/blog/page.tsx
Normal file
|
@ -0,0 +1,32 @@
|
|||
import { allBlogPosts } from 'content-collections';
|
||||
import Image from 'next/image';
|
||||
import Link from 'next/link';
|
||||
|
||||
const BlogPage = () => {
|
||||
return (
|
||||
<div className='ml-4 mr-4 flex flex-col items-center space-y-10'>
|
||||
<h1 className='text-4xl font-semibold text-neutral-700'>Blog</h1>
|
||||
<div className='grid grid-cols-2 gap-20 sm:grid-cols-3 lg:grid-cols-4'>
|
||||
{allBlogPosts.map((post) => (
|
||||
<div className='space-y-4 text-center' key={post._meta.path}>
|
||||
<Link href={`blog/posts/${post._meta.path}`}>
|
||||
<Image
|
||||
src={post.coverImage}
|
||||
height={100}
|
||||
width={300}
|
||||
alt='post cover image'
|
||||
className='aspect-video w-full rounded-md object-cover'
|
||||
/>
|
||||
<h2 className='text-lg font-semibold text-neutral-700'>
|
||||
{post.title}
|
||||
</h2>
|
||||
<p className='text-sm text-neutral-500'>{post.summary}</p>
|
||||
</Link>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default BlogPage;
|
40
app/(main)/blog/posts/[post]/page.tsx
Normal file
40
app/(main)/blog/posts/[post]/page.tsx
Normal file
|
@ -0,0 +1,40 @@
|
|||
import { MDXContent } from '@content-collections/mdx/react';
|
||||
import { allBlogPosts } from 'content-collections';
|
||||
import Image from 'next/image';
|
||||
|
||||
interface PostPageProps {
|
||||
params: Promise<{ post: string }>;
|
||||
}
|
||||
|
||||
const PostPage = async (props: PostPageProps) => {
|
||||
const params = await props.params;
|
||||
const post = allBlogPosts.find((post) => post._meta.path === params.post);
|
||||
|
||||
if (!post) {
|
||||
return (
|
||||
<h1 className='text-6xl font-semibold text-neutral-900'>
|
||||
Post not found
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='mx-auto p-4 md:p-6 lg:p-8'>
|
||||
<Image
|
||||
className='mb-2 h-64 w-full rounded-md object-cover md:h-[500px]'
|
||||
src={post.coverImage}
|
||||
width={1200}
|
||||
height={600}
|
||||
alt='post cover image'
|
||||
/>
|
||||
<h1 className='mb-12 text-center text-6xl font-bold text-neutral-900'>
|
||||
{post.title}
|
||||
</h1>{' '}
|
||||
<div className='container prose prose-headings:mt-8 prose-headings:font-semibold prose-headings:text-black prose-h1:text-5xl prose-h2:text-4xl prose-h3:text-3xl prose-h4:text-2xl prose-h5:text-xl prose-h6:text-lg prose-p:text-xl dark:prose-headings:text-white'>
|
||||
<MDXContent code={post.mdx} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PostPage;
|
14
app/(main)/blog/posts/blog-welcome.mdx
Normal file
14
app/(main)/blog/posts/blog-welcome.mdx
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: 'Welcome to the Blog!'
|
||||
summary: 'Welcome to our new blog page!'
|
||||
coverImage: '/hero.svg'
|
||||
datePublished: ''
|
||||
---
|
||||
|
||||
## Welcome!
|
||||
|
||||
Hello and welcome to our new blog page! We are so exited to finally have a place to share updates and news about our app.
|
||||
|
||||
## What's next?
|
||||
|
||||
As you can see, although we have a blog page, it's a bit basic at the moment. In the future, we are planning to add things such as tags and dates as well as other stuff. In terms of the website it's self, we have a few major feates that we plan to add in the comming months.
|
Loading…
Add table
Add a link
Reference in a new issue