{"version":3,"sources":["webpack://gatsby-starter-ghost/./src/components/common/Toc.js","webpack://gatsby-starter-ghost/./src/templates/post.js"],"names":["post","childHtmlRehype","tableOfContents","className","map","node","key","id","href","heading","data","location","ghostPost","readingTime","readingTimeHelper","relatedPost","allGhostPost","edges","type","Helmet","codeinjection_styles","primary_tag","Link","to","slug","name","title","custom_excerpt","authors","profile_image","src","alt","dateTime","published_at","published_at_pretty","feature_image","srcSet","sizes","dangerouslySetInnerHTML","__html","html","index","home"],"mappings":"uPAgBA,EAdY,SAAC,GAAc,IAAZA,EAAW,EAAXA,KAEX,QAASA,EAAKC,gBAAgBC,iBAC1B,uBAAKC,UAAU,eACX,sCACA,sBAAIA,UAAU,eACTH,EAAKC,gBAAgBC,gBAAgBE,KAAI,SAACC,GAAD,OACtC,sBAAIC,IAAKD,EAAKE,IAAI,qBAAGC,KAAI,IAAMH,EAAKE,IAAOF,EAAKI,gBCoHpE,EAzGa,SAAC,GAAwB,IAAtBC,EAAqB,EAArBA,KAAMC,EAAe,EAAfA,SACZX,EAAOU,EAAKE,UACZC,GAAcC,iBAAkBd,GAChCe,EAAcL,EAAKM,aAAaC,MAEtC,OACI,gCACI,gBAAC,IAAD,CACIP,KAAMA,EACNC,SAAUA,EACVO,KAAK,YAET,gBAACC,EAAA,EAAD,KACI,yBAAOD,KAAK,YAAZ,GAA2BlB,EAAKoB,uBAEpC,gBAAC,KAAD,KAEI,2BAASjB,UAAU,WAEf,0BAAQA,UAAU,4BACbH,EAAKqB,aACF,2BAASlB,UAAU,eACf,gBAAC,EAAAmB,KAAD,CAAMC,GAAE,QAAUvB,EAAKqB,YAAYG,MAASxB,EAAKqB,YAAYI,OAIrE,sBAAItB,UAAU,iBAAiBH,EAAK0B,OAEnC1B,EAAK2B,gBACF,qBAAGxB,UAAU,mBAAmBH,EAAK2B,gBAGzC,uBAAKxB,UAAU,kBACX,2BAASA,UAAU,0BACf,sBAAIA,UAAU,eACTH,EAAK4B,QAAQxB,KAAI,gBAAEqB,EAAF,EAAEA,KAAMI,EAAR,EAAQA,cAAeL,EAAvB,EAAuBA,KAAvB,OACd,sBAAIrB,UAAU,mBAAmBG,IAAKkB,GAC/BK,EAAgB,gBAAC,EAAAP,KAAD,CAAMC,GAAE,WAAaC,EAAQrB,UAAU,iBACtD,uBAAKA,UAAU,uBAAuB2B,IAAKD,EAAeE,IAAKN,KACzD,gBAAC,EAAAH,KAAD,CAAMC,GAAE,WAAaC,EAAQrB,UAAU,sCAAqC,gBAAC,KAAD,YAIlG,uBAAKA,UAAU,uBACX,sBAAIA,UAAU,eAAeH,EAAK4B,QAAQxB,KAAI,gBAAEqB,EAAF,EAAEA,KAAMD,EAAR,EAAQA,KAAR,OAC1C,wBAAMlB,IAAKkB,GAAOC,OAEtB,uBAAKtB,UAAU,uBAEX,wBAAMA,UAAU,mBAAmB6B,SAAUhC,EAAKiC,cAAejC,EAAKkC,qBACtE,wBAAM/B,UAAU,uBAAsB,wBAAMA,UAAU,QAAhB,KAAtC,IAA4EU,OAM3Fb,EAAKmC,eACF,0BAAQhC,UAAU,iBACd,uBACIiC,OAAWpC,EAAKmC,cAAV,mDACAnC,EAAKmC,cADL,mDAEAnC,EAAKmC,cAFL,oDAGAnC,EAAKmC,cAHL,SAINE,MAAM,mCACNP,IAAK9B,EAAKmC,cACVJ,IAAK/B,EAAK0B,SAKtB,gBAAC,EAAD,CAAK1B,KAAMA,KAGf,2BAASG,UAAU,uBAAuBmC,wBAAyB,CAAEC,OAAQvC,EAAKwC,WAInFzB,GACC,yBAAOZ,UAAU,kBACb,uBAAKA,UAAU,mBACVY,EAAYX,KAAI,WAAWqC,GAAX,IAAGpC,EAAH,EAAGA,KAAH,OAEb,gBAAC,KAAD,CAAUC,IAAKD,EAAKE,GAAIP,KAAMK,EAAMoC,MAAOA,EAAOC,MAAM","file":"component---src-templates-post-js-7a0e5e92aba55d768f6b.js","sourcesContent":["import React from 'react'\n\nconst Toc = ({ post }) => {\n\n return !!post.childHtmlRehype.tableOfContents && (\n
\n

Xem nhanh

\n
    \n {post.childHtmlRehype.tableOfContents.map((node) => (\n
  1. {node.heading}
  2. \n ))}\n
\n
\n )\n}\n\nexport default Toc","import React from 'react'\nimport PropTypes from 'prop-types'\nimport { Link, StaticQuery, graphql } from 'gatsby'\nimport { Helmet } from 'react-helmet'\n\nimport { Layout, PostCard } from '../components/common'\nimport { MetaData } from '../components/common/meta'\n\nimport { Avatar } from '../components/common/meta/Icon'\nimport { readingTime as readingTimeHelper } from '@tryghost/helpers'\n\nimport Toc from '../components/common/Toc'\n\n/**\n* Single post view (/:slug)\n*\n* This file renders a single post and loads all the content.\n*\n*/\n\nconst Post = ({ data, location }) => {\n const post = data.ghostPost\n const readingTime = readingTimeHelper(post)\n const relatedPost = data.allGhostPost.edges\n\n return (\n <>\n \n \n \n \n \n\n
\n\n
\n {post.primary_tag && \n
\n {post.primary_tag.name}\n
\n }\n\n

{post.title}

\n\n {post.custom_excerpt && \n

{post.custom_excerpt}

\n }\n\n
\n
\n
    \n {post.authors.map(({name, profile_image, slug}) => (\n
  • \n {!!profile_image ? \n {name}\n : }\n
  • \n ))}\n
\n
\n

{post.authors.map(({name, slug}) => (\n {name}\n ))}

\n
\n \n \n {readingTime}\n
\n
\n
\n
\n \n {post.feature_image && \n
\n \n
\n }\n\n \n
\n \n
\n
\n\n {/* Read more links, just above the footer */}\n {!!relatedPost && \n \n }\n \n
\n \n )\n}\n\nPost.propTypes = {\n data: PropTypes.shape({\n ghostPost: PropTypes.shape({\n codeinjection_styles: PropTypes.object,\n title: PropTypes.string.isRequired,\n html: PropTypes.string.isRequired,\n feature_image: PropTypes.string,\n }).isRequired,\n }).isRequired,\n location: PropTypes.object.isRequired,\n}\n\nexport default Post\n\nexport const postQuery = graphql`\n query($slug: String!, $slug_tag: String) {\n ghostPost(slug: { eq: $slug }) {\n ...GhostPostFields\n childHtmlRehype {\n tableOfContents\n }\n }\n\n allGhostPost(\n filter: {tags: {elemMatch: {slug: {eq: $slug_tag}}}, slug: { ne: $slug }},\n limit: 3\n ) {\n edges {\n node {\n ...GhostPostFields\n }\n }\n }\n\n }\n`\n"],"sourceRoot":""}