-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomponent---src-templates-category-page-js-86501a757a6f06dff622.js.map
1 lines (1 loc) · 6.03 KB
/
component---src-templates-category-page-js-86501a757a6f06dff622.js.map
1
{"version":3,"sources":["webpack:///./src/utils/helpers.js","webpack:///./src/components/PostFrontmatter.js","webpack:///./src/templates/category-page.js","webpack:///./src/components/PostListTitle.js"],"names":["formatReadingTime","minutes","cups","Math","round","Array","E","fill","join","CategoryLink","styled","Link","PostFrontmatter","date","timeToRead","category","isInPost","Container","children","style","scale","display","marginBottom","rhythm","to","CategoryPage","data","location","pageContext","siteTitle","site","siteMetadata","title","posts","allMarkdownRemark","edges","slice","map","node","frontmatter","fields","slug","key","boxShadow","dangerouslySetInnerHTML","__html","description","excerpt","pageQuery","PostListTitle","textTransform","borderBottom"],"mappings":"2FAAO,SAASA,EAAkBC,GAChC,IAAIC,EAAOC,KAAKC,MAAMH,EAAU,GAChC,OAAIC,EAAO,EACC,IAAIG,MAAMF,KAAKC,MAAMF,EAAOC,KAAKG,IACxCC,KAAK,MACLC,KAAK,IAFR,IAEeP,EAFf,YAIU,IAAII,MAAMH,GAAQ,GAAGK,KAAK,MAAMC,KAAK,IAA/C,IAAsDP,EAAtD,YAPJ,mC,kCCAA,yEAOMQ,EAAeC,YAAOC,QAAV,oFAAGD,CAAH,2IAkDHE,IAhCS,SAAC,GAA8C,IAA5CC,EAA2C,EAA3CA,KAAMC,EAAqC,EAArCA,WAAYC,EAAyB,EAAzBA,SAAUC,EAAe,EAAfA,SAC/CC,EAAY,SAAC,GAAD,IAAGC,EAAH,EAAGA,SAAH,OAAkBF,EAGhC,uBACEG,MAAK,iBACAC,aAAM,IADN,CAEHC,QAAQ,QACRC,aAAcC,YAAO,MAJzB,IAMGL,GAIH,+BAAQA,IAGZ,OACE,kBAACD,EAAD,KACGJ,EACAC,GAAU,MAAUd,YAAkBc,GAErCC,GACA,kBAACN,EAAD,CAAce,GAAE,IAAMT,GACpB,6BACCA,M,kCClDX,kJA+CeU,UAtCM,SAAC,GAAqC,IAAnCC,EAAkC,EAAlCA,KAAMC,EAA4B,EAA5BA,SAAUC,EAAkB,EAAlBA,YAChCC,EAAYH,EAAKI,KAAKC,aAAaC,MACnCC,EAAQP,EAAKQ,kBAAkBC,MAC/BpB,EAAWa,EAAYb,SAASqB,MAAM,GAAI,GAEhD,OACE,kBAAC,IAAD,CAAQT,SAAUA,EAAUK,MAAOH,GACjC,kBAAC,IAAD,CAAKG,MAAOjB,IACZ,kBAAC,IAAD,CAAeiB,MAAOjB,IACrBkB,EAAMI,KAAI,YAAe,IAAZC,EAAW,EAAXA,KACNN,EAAQM,EAAKC,YAAYP,OAASM,EAAKE,OAAOC,KACpD,OACE,6BAASC,IAAKJ,EAAKE,OAAOC,MACxB,gCACE,wBAAItB,MAAO,CAAEG,aAAcC,YAAO,EAAI,KACpC,kBAAC,OAAD,CAAMJ,MAAO,CAAEwB,UAAU,QAAWnB,GAAIc,EAAKE,OAAOC,MACjDT,IAGL,kBAAC,IAAD,CACEnB,KAAMyB,EAAKC,YAAY1B,KACvBC,WAAYwB,EAAKxB,cAGrB,iCACE,uBACE8B,wBAAyB,CACvBC,OAAQP,EAAKC,YAAYO,aAAeR,EAAKS,kBAaxD,IAAMC,EAAS,c,kCCjDtB,yBAaeC,IAXO,SAAC,GAAe,IAAbjB,EAAY,EAAZA,MACvB,OACE,wBAAIb,MAAO,CACT+B,cAAc,YACdC,aAAa,MAEZnB","file":"component---src-templates-category-page-js-86501a757a6f06dff622.js","sourcesContent":["export function formatReadingTime(minutes) {\n let cups = Math.round(minutes / 5);\n if (cups > 5) {\n return `${new Array(Math.round(cups / Math.E))\n .fill('🍱')\n .join('')} ${minutes} min read`;\n } else {\n return `${new Array(cups || 1).fill('☕️').join('')} ${minutes} min read`;\n }\n}","import React from \"react\"\nimport { Link } from \"gatsby\"\nimport styled from \"styled-components\"\nimport { rhythm, scale } from \"../utils/typography\"\n\nimport { formatReadingTime } from \"../utils/helpers\"\n\nconst CategoryLink = styled(Link)`\n opacity: 0.75;\n ::before {\n content: \" • \";\n }\n br {\n display: none;\n }\n @media screen and (max-width: 768px) {\n ::before {\n display: none;\n }\n br {\n display: inline;\n }\n }\n`\n\nconst PostFrontmatter = ({ date, timeToRead, category, isInPost }) => {\n const Container = ({ children }) => isInPost\n ?\n (\n <p\n style={{\n ...scale(-1 / 5),\n display: `block`,\n marginBottom: rhythm(1),\n }}\n > {children}</p>\n )\n :\n (\n <small>{children}</small>\n )\n\n return (\n <Container>\n {date}\n {timeToRead && ` • ${formatReadingTime(timeToRead)}`}\n {\n category &&\n <CategoryLink to={`/${category}`}>\n <br />\n {category}\n </CategoryLink>\n }\n </Container>\n )\n}\n\nexport default PostFrontmatter","import React from \"react\"\nimport { Link, graphql } from \"gatsby\"\n\nimport Layout from \"../components/Layout\"\nimport SEO from \"../components/Seo\"\nimport PostListTitle from \"../components/PostListTitle\"\nimport PostFrontmatter from \"../components/PostFrontmatter\"\nimport { rhythm } from \"../utils/typography\"\n\nconst CategoryPage = ({ data, location, pageContext }) => {\n const siteTitle = data.site.siteMetadata.title\n const posts = data.allMarkdownRemark.edges\n const category = pageContext.category.slice(2, -1)\n\n return (\n <Layout location={location} title={siteTitle}>\n <SEO title={category} />\n <PostListTitle title={category} />\n {posts.map(({ node }) => {\n const title = node.frontmatter.title || node.fields.slug\n return (\n <article key={node.fields.slug}>\n <header>\n <h3 style={{ marginBottom: rhythm(1 / 4) }}>\n <Link style={{ boxShadow: `none` }} to={node.fields.slug}>\n {title}\n </Link>\n </h3>\n <PostFrontmatter\n date={node.frontmatter.date}\n timeToRead={node.timeToRead}\n />\n </header>\n <section>\n <p\n dangerouslySetInnerHTML={{\n __html: node.frontmatter.description || node.excerpt,\n }}\n />\n </section>\n </article>\n )\n })}\n </Layout>\n )\n}\n\nexport default CategoryPage\n\nexport const pageQuery = graphql`\n query CategoryPage($category: String) {\n site {\n siteMetadata {\n title\n }\n }\n allMarkdownRemark(\n filter: {frontmatter: {category: {regex: $category }}}\n sort: { fields: [frontmatter___date], order: DESC }\n ) {\n edges {\n node {\n excerpt\n fields {\n slug\n }\n timeToRead\n frontmatter {\n date(formatString: \"MMMM DD, YYYY\")\n title\n description\n category\n }\n }\n }\n }\n }\n`\n","import React from \"react\";\n\nconst PostListTitle = ({ title }) => {\n return (\n <h2 style={{\n textTransform: `uppercase`,\n borderBottom: `0`,\n }}>\n {title}\n </h2>\n )\n}\n\nexport default PostListTitle\n"],"sourceRoot":""}