SHARE
TWEET

Untitled

a guest Dec 15th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from "react";
  2. import { graphql, Link } from "gatsby";
  3.  
  4. export default ({ data }) => {
  5.   console.log(data);
  6.   const {
  7.     markdownRemark: { frontmatter, html }
  8.   } = data;
  9.  
  10.   return (
  11.     <div>
  12.       <Link to="blog">Back to blog!</Link>
  13.       <h1>{frontmatter.title}</h1>
  14.       <small>
  15.         {frontmatter.author.join(" and ")}, {frontmatter.date}
  16.       </small>
  17.       <div dangerouslySetInnerHTML={{ __html: html }} />
  18.     </div>
  19.   );
  20. };
  21.  
  22. export const pageQuery = graphql`
  23.   query BlogPostPageQuery($slug: String!) {
  24.     markdownRemark(frontmatter: { slug: { eq: $slug } }) {
  25.       frontmatter {
  26.         author
  27.         date(fromNow: true)
  28.         slug
  29.         title
  30.       }
  31.       html
  32.     }
  33.   }
  34. `;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top