feat(resources): improve SEO by attaching excerpt as description

This commit is contained in:
Jean-Philippe Sirois
2019-11-05 14:52:52 -08:00
parent 57561f8104
commit 5259235277
+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