-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added code-syntex-highlight in blog post
- Loading branch information
Showing
17 changed files
with
724 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"version": "1.0.0", | ||
"author": "Shuvo <[email protected]>", | ||
"dependencies": { | ||
"@deckdeckgo/highlight-code": "^2.2.1", | ||
"bootstrap": "^4.5.3", | ||
"disqus-react": "^1.0.10", | ||
"font-awesome": "^4.7.0", | ||
|
@@ -16,6 +17,7 @@ | |
"gatsby-plugin-offline": "^3.3.3", | ||
"gatsby-plugin-react-helmet": "^3.3.14", | ||
"gatsby-plugin-sharp": "^2.7.1", | ||
"gatsby-remark-highlight-code": "^2.1.0", | ||
"gatsby-remark-images": "^3.5.1", | ||
"gatsby-source-filesystem": "^2.4.2", | ||
"gatsby-transformer-remark": "^2.9.2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,52 @@ | ||
import React from 'react' | ||
import { Link } from 'gatsby' | ||
import { Card, CardBody, CardText, CardTitle, CardSubtitle } from 'reactstrap' | ||
import Img from 'gatsby-image' | ||
import { slugify } from '../utils/utilityFunctions' | ||
import React from "react" | ||
import { Link } from "gatsby" | ||
import { Card, CardBody, CardText, CardTitle, CardSubtitle } from "reactstrap" | ||
import Img from "gatsby-image" | ||
|
||
const Post = (props) => { | ||
const { title, path, date, body, image, tags } = props.post; | ||
|
||
return ( | ||
<Card | ||
className={`${props.noMargin ? "" : "mb-5"} ${ | ||
props.columnView ? "blog-card" : "" | ||
}`} | ||
> | ||
<Link to={path}> | ||
<Img className="card-img-top" fluid={image} /> | ||
</Link> | ||
<CardBody> | ||
<CardTitle tag="h5"> | ||
<Link to={path}>{title}</Link> | ||
</CardTitle> | ||
<CardSubtitle className="text-muted">{date}</CardSubtitle> | ||
<hr /> | ||
<CardText>{body}</CardText> | ||
import { slugify } from "../utils/utilityFunctions" | ||
|
||
<div className="d-flex align-items-center mt-auto flex-wrap"> | ||
<ul className="post-tags"> | ||
{tags.map((tag, i) => ( | ||
<li key={i}> | ||
<Link | ||
className="badge badge-default p-2 px-2 tag" | ||
to={`/tag/${slugify(tag)}`} | ||
> | ||
{tag} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
const Post = props => { | ||
const { title, path, date, body, image, tags } = props.post | ||
|
||
<Link to={path} className="btn btn-outline-primary ml-auto"> | ||
Read Post | ||
</Link> | ||
</div> | ||
</CardBody> | ||
</Card> | ||
) | ||
return ( | ||
<Card | ||
className={`${props.noMargin ? "" : "mb-5"} ${ | ||
props.columnView ? "blog-card" : "" | ||
}`} | ||
> | ||
<Link to={path}> | ||
<Img className="card-img-top" fluid={image} /> | ||
</Link> | ||
<CardBody> | ||
<CardTitle tag="h5"> | ||
<Link to={path}>{title}</Link> | ||
</CardTitle> | ||
<CardSubtitle className="text-muted">{date}</CardSubtitle> | ||
<hr /> | ||
<CardText>{body}</CardText> | ||
|
||
<div className="d-flex align-items-center mt-auto flex-wrap"> | ||
<ul className="post-tags"> | ||
{tags.map((tag, i) => ( | ||
<li key={i}> | ||
<Link | ||
className="badge badge-default p-2 px-2 tag" | ||
to={`/tag/${slugify(tag)}`} | ||
> | ||
{tag} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
|
||
<Link to={path} className="btn btn-outline-primary ml-auto"> | ||
Read Post | ||
</Link> | ||
</div> | ||
</CardBody> | ||
</Card> | ||
) | ||
} | ||
|
||
export default Post |
Oops, something went wrong.