-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-pages-tag-template-js-7c82b79c45bd9ab40554.js.map
1 lines (1 loc) · 2.63 KB
/
component---src-pages-tag-template-js-7c82b79c45bd9ab40554.js.map
1
{"version":3,"sources":["webpack:///./src/pages/tagTemplate.js"],"names":["Tags","pageContext","data","tag","allMarkdownRemark","edges","totalCount","tagHeader","map","node","frontmatter","path","title","key","to","pageQuery"],"mappings":"2FAAA,sFAuDeA,UAnDF,SAAC,GAAyB,IAAxBC,EAAuB,EAAvBA,YAAaC,EAAU,EAAVA,KACnBC,EAAOF,EAAPE,IAEP,GAAGD,EAAKE,kBAAmB,CAAC,IAAD,EACGF,EAAKE,kBAA1BC,EADkB,EAClBA,MAAOC,EADW,EACXA,WACRC,EAAeD,EAAN,SACE,IAAfA,EAAmB,GAAK,KADX,iBAEIH,EAFJ,IAIf,OACE,6BACE,4BAAKI,GACL,4BACGF,EAAMG,KAAI,YAAa,IAAD,IAAVC,KACgBC,YAApBC,EADc,EACdA,KAAMC,EADQ,EACRA,MACb,OACE,wBAAIC,IAAKF,GACP,kBAAC,OAAD,CAAMG,GAAIH,GAAOC,QAKzB,kBAAC,OAAD,CAAME,GAAG,SAAT,aAKN,MAAO,wBA0BF,IAAMC,EAAS","file":"component---src-pages-tag-template-js-7c82b79c45bd9ab40554.js","sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport {Link, graphql} from 'gatsby'\n\nconst Tags = ({pageContext, data}) => {\n const {tag} = pageContext\n\n if(data.allMarkdownRemark) {\n const {edges, totalCount} = data.allMarkdownRemark\n const tagHeader = `${totalCount} post${\n totalCount === 1 ? '' : 's'\n } tagged with '${tag}'`\n\n return (\n <div>\n <h1>{tagHeader}</h1>\n <ul>\n {edges.map(({node}) => {\n const {path, title} = node.frontmatter\n return (\n <li key={path}>\n <Link to={path}>{title}</Link>\n </li>\n )\n })}\n </ul>\n <Link to='/tags'>All tags</Link>\n </div>\n )\n }\n\n return 'markdown edges null!';\n}\n\nTags.propTypes = {\n pageContext: PropTypes.shape({\n tag: PropTypes.string.isRequired,\n }),\n data: PropTypes.shape({\n allMarkdownRemark: PropTypes.shape({\n totalCount: PropTypes.number.isRequired,\n edges: PropTypes.arrayOf(\n PropTypes.shape({\n node: PropTypes.shape({\n frontmatter: PropTypes.shape({\n path: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n }),\n }),\n }).isRequired\n ),\n }),\n }),\n}\n\nexport default Tags\n\nexport const pageQuery = graphql`\n query($tag: String) {\n allMarkdownRemark(\n limit: 2000\n sort: { fields: [frontmatter___date], order: DESC }\n filter: {frontmatter: {tags: {in: [$tag]}, published: {eq: true}}}\n ) {\n totalCount\n edges {\n node {\n frontmatter {\n title\n path\n }\n }\n }\n }\n }\n`"],"sourceRoot":""}