diff --git a/pages/blog/posts/[slug].page.tsx b/pages/blog/posts/[slug].page.tsx index 4f4ce4d9a..4fa49f08f 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,32 @@ export default function StaticMarkdownPage({ style={{ backgroundImage: `url(${frontmatter.cover})` }} /> +
+ + Share this article: + + + + Share on X + + + Share on LinkedIn + +