Merge pull request #158 from the-programmers-hangout/feat-improve-seo

feat(resources): improve SEO by attaching excerpt as description
This commit is contained in:
Jean-Philippe Sirois
2019-11-06 09:29:52 -08:00
committed by GitHub
+3 -2
View File
@@ -9,11 +9,11 @@ import "katex/dist/katex.min.css"
// @todo maybe find alternative type for data // @todo maybe find alternative type for data
const LanguagePost: FC<any> = ({ data }) => { const LanguagePost: FC<any> = ({ data }) => {
const { relativePath } = data.file const { relativePath } = data.file
const { html, fields, frontmatter, timeToRead } = data.file.post const { html, excerpt, fields, frontmatter, timeToRead } = data.file.post
return ( return (
<Fragment> <Fragment>
<SEO title={frontmatter.title} /> <SEO title={frontmatter.title} description={excerpt} />
<ResourceHeader <ResourceHeader
relativePath={relativePath} relativePath={relativePath}
title={frontmatter.title} title={frontmatter.title}
@@ -36,6 +36,7 @@ export const query = graphql`
relativePath relativePath
post: childMarkdownRemark { post: childMarkdownRemark {
html html
excerpt
fields { fields {
authors { authors {
name name