From fa11e81ab2ce42d9eb9cd5070e3d7b6b820601b7 Mon Sep 17 00:00:00 2001 From: Priyanshu Kumar <110410015+cbum-dev@users.noreply.github.com> Date: Wed, 18 Jun 2025 20:50:08 +0530 Subject: [PATCH 1/2] Update [slug].page.tsx --- pages/blog/posts/[slug].page.tsx | 40 ++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/pages/blog/posts/[slug].page.tsx b/pages/blog/posts/[slug].page.tsx index 4f4ce4d9a..874b682e6 100644 --- a/pages/blog/posts/[slug].page.tsx +++ b/pages/blog/posts/[slug].page.tsx @@ -17,19 +17,31 @@ import Image from 'next/image'; export async function getStaticPaths() { return getStaticMarkdownPaths('pages/blog/posts'); } -export async function getStaticProps(args: any) { - return getStaticMarkdownProps(args, 'pages/blog/posts'); +export async function getStaticProps({ params }: any) { + const staticProps = await getStaticMarkdownProps( + { params }, + 'pages/blog/posts', + ); + return { + props: { + ...staticProps.props, + slug: params.slug, + }, + }; } export default function StaticMarkdownPage({ frontmatter, content, + slug, }: { frontmatter: any; content: any; + slug: string; }) { const date = new Date(frontmatter.date); const timeToRead = Math.ceil(readingTime(content).minutes); + const blogUrl = `https://json-schema.org/blog/posts/${slug}`; return ( @@ -116,6 +128,30 @@ export default function StaticMarkdownPage({ style={{ backgroundImage: `url(${frontmatter.cover})` }} /> +
+ Share this article: + + + Share on X + + + Share on LinkedIn + +
From 80253043600fe2366f2d912b9ee8aa31b945ca0e Mon Sep 17 00:00:00 2001 From: Priyanshu Kumar <110410015+cbum-dev@users.noreply.github.com> Date: Mon, 30 Jun 2025 21:26:04 +0530 Subject: [PATCH 2/2] fixed mobile --- pages/blog/posts/[slug].page.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pages/blog/posts/[slug].page.tsx b/pages/blog/posts/[slug].page.tsx index 874b682e6..4fa49f08f 100644 --- a/pages/blog/posts/[slug].page.tsx +++ b/pages/blog/posts/[slug].page.tsx @@ -128,8 +128,10 @@ export default function StaticMarkdownPage({ style={{ backgroundImage: `url(${frontmatter.cover})` }} /> -
- Share this article: +
+ + Share this article: + Share on X @@ -147,7 +149,7 @@ export default function StaticMarkdownPage({ )}&title=${encodeURIComponent(frontmatter.title)}`} target='_blank' rel='noopener noreferrer' - className='text-blue-500 font-medium hover:underline' + className='text-blue-500 text-center font-medium hover:underline' > Share on LinkedIn