diff --git a/src/theme/BlogPostPage/index.js b/src/theme/BlogPostPage/index.js new file mode 100644 index 0000000..f49a246 --- /dev/null +++ b/src/theme/BlogPostPage/index.js @@ -0,0 +1,62 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React, { useEffect } from "react"; + +import Layout from "@theme/Layout"; +import BlogPostItem from "@theme/BlogPostItem"; +import BlogPostPaginator from "@theme/BlogPostPaginator"; + +function BlogPostPage(props) { + const { content: BlogPostContents } = props; + const { frontMatter, metadata } = BlogPostContents; + + useEffect(() => { + const script = document.createElement("script"); + + script.src = "https://utteranc.es/client.js"; + script.setAttribute("repo", "sahrckr/profile"); + script.setAttribute("issue-term", "url"); + script.setAttribute("label", "blog-post-comment"); + script.setAttribute("theme", "preferred-color-scheme"); + script.crossOrigin = "anonymous"; + script.async = true; + + document.getElementById("comment-system").appendChild(script); + }, []); + + return ( + + {BlogPostContents && ( +
+
+
+ + + +
+ {(metadata.nextItem || metadata.prevItem) && ( +
+ +
+ )} +
+
+
+ )} +
+ ); +} + +export default BlogPostPage;