From d00f6e69fd11f8178c56cad1e10783ecc22f548b Mon Sep 17 00:00:00 2001 From: trash07 Date: Sun, 5 Apr 2026 21:12:17 -0400 Subject: [PATCH] feat: update post page --- src/components/layout/PostLayout.jsx | 32 ++++++++++++++-------------- src/pages/index.jsx | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/layout/PostLayout.jsx b/src/components/layout/PostLayout.jsx index 232808b..561b32f 100644 --- a/src/components/layout/PostLayout.jsx +++ b/src/components/layout/PostLayout.jsx @@ -2,30 +2,32 @@ import * as React from 'react'; import '../../css/post.css'; import Header from '../fragment/Header'; import Footer from '../fragment/Footer'; +import { getSiteUrl } from '../utils/url-generator'; -export function PostLayout(props) { - const { title, children } = props; - console.log(props); +export function PostLayout({ title, children }) { + const { frontmatter } = children.props.pageContext; return ( <>
- +
- Node.js - Express - REST API + {frontmatter.tags.map((tag, index) => ( + + {tag} + + ))}

{title}

-
JD
- Jane Doe +
LK
+ {frontmatter.author}
- March 18, 2026 +
8 min read
@@ -38,17 +40,15 @@ export function PostLayout(props) { ); } -function Breadcrumb() { +function Breadcrumb({ title }) { return (
- Home + Accueil - Tutorials + Tutoriels - - Building a REST API with Node.js and Express - + {title}
); diff --git a/src/pages/index.jsx b/src/pages/index.jsx index c54922d..069a229 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -23,14 +23,14 @@ const IndexPage = ({ data }) => {
{posts.map((post, index) => ( - + ))}
); }; -function PostDatails(post) { +function PostDetails(post) { const { frontmatter } = post.pos; return (