diff --git a/uli-website/src/pages/blog/index.jsx b/uli-website/src/pages/blog/index.jsx index 3319f1df..631c3c46 100644 --- a/uli-website/src/pages/blog/index.jsx +++ b/uli-website/src/pages/blog/index.jsx @@ -1,12 +1,18 @@ import React from "react"; -import { Box, Heading, Text, Anchor, Paragraph } from "grommet"; +import { Box, Heading, Text, Paragraph } from "grommet"; import { graphql } from "gatsby"; import AppShell from "../../components/molecules/AppShell"; import { NavLink } from "../../components/atoms/UliCore"; const BlogIndex = ({ data }) => { const blogs = data.allMdx.nodes; - console.log(blogs); + + // Function to convert timestamp to readable date + const formatDate = (timestamp) => { + const date = new Date(parseInt(timestamp)); // Timestamp ko date mein convert kar rahe hain + return date.toLocaleDateString(); // Date ko readable format mein dikhana + }; + return ( @@ -15,12 +21,18 @@ const BlogIndex = ({ data }) => { {blogs.map((blog) => { return ( - + - + {blog.frontmatter.name}, - {" " + blog.frontmatter.author} + {blog.frontmatter.author} + {/* Publish date ko yahan display kiya gaya hai */} + + Published on: {formatDate(blog.frontmatter.date)} + );