Skip to content

Commit 1b98858

Browse files
bhansaRajatRajdeep
andauthored
Add blog section with navigation and blog post component (#129)
Co-authored-by: Rajat Rajdeep <rajatrajdeep@outlook.com> Co-authored-by: Rajat Rajdeep <46029666+RajatRajdeep@users.noreply.github.com>
1 parent a3b204f commit 1b98858

File tree

5 files changed

+70
-3
lines changed

5 files changed

+70
-3
lines changed

data/navItems.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ export const NAV_ITEMS = [
3939
path: '/tickets',
4040
target: '_self',
4141
},
42+
{
43+
name: 'Blog',
44+
path: '/blogs',
45+
target: '_self',
46+
},
4247
{
4348
name: 'Jobs',
4449
children: [

pages-content/welcomeGuide.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import Link from 'next/link';
2-
31
We're thrilled to have you join us for the 5th edition of PyConf Hyderabad! Get ready for two days of insightful talks, hands-on workshops, and networking with fellow Python enthusiasts. Whether you're a first-time attendee or a returning participant, we can't wait to make this experience memorable for you.
42

53
We have listed some essential things you should know before attending. Please take some time to go through the below details to make the most out of the event.
@@ -95,7 +93,6 @@ Follow us on social media for live updates! Share your experience using #PyConfH
9593

9694
- Conference Day at T-Hub: 040-66396639, 09581474545
9795

98-
9996
## Code of Conduct
10097

10198
All participants and speakers are expected to adhere to the **Code of Conduct of PyConf Hyderabad 2025**. Please take a moment to review it here: [Code Of Conduct](/code-of-conduct)

src/app/blogs/page.jsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
import { BLOGS } from '@/blogs';
3+
import BlogPostItem from '@/components/BlogPostItem';
4+
import Link from 'next/link';
5+
import { Heading } from '@/components/Typography';
6+
7+
const BlogList = () => {
8+
return (
9+
<section className="flex flex-col items-center py-6 w-11/12 lg:w-5/6 mx-auto">
10+
<Heading
11+
tagLevel={1}
12+
level={1}
13+
className="text-center my-8 text-secondary-600 dark:text-secondary-400"
14+
>
15+
Blog
16+
</Heading>
17+
<ul className='w-full lg:w-8/12'>
18+
{BLOGS.map((blog) => (
19+
<Link key={blog.id} href={`/blogs/${blog.slug}`}>
20+
<li>
21+
<BlogPostItem blog={blog} />
22+
</li>
23+
</Link>
24+
))}
25+
</ul>
26+
</section>
27+
);
28+
};
29+
30+
export default BlogList;

src/components/BlogPostItem.jsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import Icon from '@/components/Icon';
2+
import { Span, Heading, Paragraph } from '@/components/Typography';
3+
4+
const BlogPostItem = ({ blog }) => {
5+
return (
6+
<article className="flex flex-col gap-2 p-6 my-6 bg-gray-50 rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700">
7+
<div className="flex flex-wrap gap-2 justify-between items-center mb-2 text-gray-500">
8+
<Span className="bg-primary-100 text-primary-800 text-xs font-medium inline-flex items-center px-2.5 py-0.5 rounded dark:bg-primary-200 dark:text-primary-800">
9+
<Icon name="Announcement" size={16} className="mr-2" />
10+
{blog.category || 'Announcement'}
11+
</Span>
12+
<Span className="text-gray-600 dark:text-gray-100">
13+
{new Date(blog.publishedAt).toLocaleDateString('en-US', {
14+
month: 'short',
15+
day: 'numeric',
16+
year: 'numeric',
17+
})}
18+
</Span>
19+
</div>
20+
<Heading level={4} tagLevel={2} className="text-secondary-600 dark:text-secondary-400">
21+
{blog.title}
22+
</Heading>
23+
<Span className="font-medium dark:text-gray-50">
24+
Author: {blog.author}
25+
</Span>
26+
<Span className="font-medium text-primary-600 dark:text-primary-500 hover:underline">
27+
Read more
28+
</Span>
29+
</article>
30+
);
31+
};
32+
33+
export default BlogPostItem;

src/components/Icon.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
FaLocationDot,
1616
FaGlobe,
1717
FaYoutube,
18+
FaVolumeLow,
1819
} from 'react-icons/fa6';
1920
import { FaExternalLinkAlt, FaArrowCircleRight } from 'react-icons/fa';
2021
import { MdLightMode, MdDarkMode } from 'react-icons/md';
@@ -45,6 +46,7 @@ const icons = {
4546
Youtube: FaYoutube,
4647
ExternalLink: FaExternalLinkAlt,
4748
ArrowCircleRight: FaArrowCircleRight,
49+
Announcement: FaVolumeLow,
4850
};
4951

5052
export const Icon = ({ name, size = 36, className = '', padding = 0 }) => {

0 commit comments

Comments
 (0)