Commit 22ea8ee6 authored by Afzaal Ahmad Zeeshan's avatar Afzaal Ahmad Zeeshan 😴

Fixed build breaking changes.

parent 2b83a8ee
Pipeline #107016314 passed with stages
in 2 minutes and 45 seconds
......@@ -3,7 +3,7 @@ title: "Software Developer's New Year Resolution: 2020"
date: "2020-01-01T00:00:00.000Z"
author: "Afzaal Ahmad Zeeshan"
tags: [ "happy new year", "software developer" ]
published: false
published: true
---
I am about to be a decade old in software development, and open source communities.
......
......@@ -42,6 +42,7 @@ module.exports = {
`gatsby-remark-prismjs`,
`gatsby-remark-copy-linked-files`,
`gatsby-remark-smartypants`,
`gatsby-remark-autolink-headers`,
],
},
},
......@@ -79,6 +80,6 @@ module.exports = {
options: {
sitemapSize: 5000
}
}
},
],
}
const path = require(`path`)
const { createFilePath } = require(`gatsby-source-filesystem`)
const _ = require('lodash')
exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions
const blogPost = path.resolve(`./src/templates/blog-post.js`)
const tagTemplate = path.resolve(`./src/templates/tag.js`)
const result = await graphql(
`
{
......
......@@ -7803,6 +7803,33 @@
"warning": "^3.0.0"
}
},
"gatsby-remark-autolink-headers": {
"version": "2.1.21",
"resolved": "https://registry.npmjs.org/gatsby-remark-autolink-headers/-/gatsby-remark-autolink-headers-2.1.21.tgz",
"integrity": "sha512-2GvQrlmkxduU9ZFMoU7o2Psb1kAFN8Wh4Fhqdj3WSNJwWmIYgGXs5xl+W6dLotjKwfL9Zxv8zHnx2HDxum6WCg==",
"requires": {
"@babel/runtime": "^7.7.6",
"github-slugger": "^1.2.1",
"lodash": "^4.17.15",
"mdast-util-to-string": "^1.0.7",
"unist-util-visit": "^1.4.1"
},
"dependencies": {
"@babel/runtime": {
"version": "7.7.7",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.7.tgz",
"integrity": "sha512-uCnC2JEVAu8AKB5do1WRIsvrdJ0flYx/A/9f/6chdacnEZ7LmavjdsDXr5ksYBegxtuTPR5Va9/+13QF/kFkCA==",
"requires": {
"regenerator-runtime": "^0.13.2"
}
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
}
}
},
"gatsby-remark-copy-linked-files": {
"version": "2.1.31",
"resolved": "https://registry.npmjs.org/gatsby-remark-copy-linked-files/-/gatsby-remark-copy-linked-files-2.1.31.tgz",
......@@ -10494,9 +10521,9 @@
}
},
"lodash": {
"version": "4.17.14",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
"integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw=="
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"lodash._reinterpolate": {
"version": "3.0.0",
......
......@@ -13,6 +13,11 @@ class BlogPostTemplate extends React.Component {
const siteTitle = this.props.data.site.siteMetadata.title
const { previous, next } = this.props.pageContext
let tableOfContents = "";
if(post.tableOfContents && post.tableOfContents.length > 0) {
tableOfContents = <div><h4>Table of contents</h4><div dangerouslySetInnerHTML={{__html: post.tableOfContents}}></div><hr/></div>;
}
return (
<Layout location={this.props.location} title={siteTitle}>
<SEO
......@@ -39,6 +44,9 @@ class BlogPostTemplate extends React.Component {
{post.frontmatter.date}
</p>
</header>
<div>
{tableOfContents}
</div>
<section dangerouslySetInnerHTML={{ __html: post.html }} />
<hr
style={{
......@@ -95,6 +103,7 @@ export const pageQuery = graphql`
id
excerpt(pruneLength: 160)
html
tableOfContents
frontmatter {
title
date(formatString: "MMMM DD, YYYY")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment