Skip to content

Commit

Permalink
Fix feed titles (mostly) (#1181)
Browse files Browse the repository at this point in the history
* Fix share buttons by importing slug via GraphQL

I overlooked the slug when the schema changed in the Models update.

* Fix blog post titles on blog feed

Also remove frontmatter application since the nodes don't have it anymore
I need to improve this more but it's a partial fix
  • Loading branch information
rogermparent authored Apr 22, 2020
1 parent 903af77 commit e9ccdfa
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,18 @@ const plugins = [
`,
serialize: ({ query: { site, allBlogPost } }) => {
return allBlogPost.nodes.map(node => {
return Object.assign({}, node.frontmatter, {
/* eslint-disable-next-line @typescript-eslint/camelcase */
custom_elements: [{ 'content:encoded': node.html }],
date: node.date,
description: node.description,
guid: site.siteMetadata.siteUrl + node.slug,
url: site.siteMetadata.siteUrl + node.slug
})
return Object.assign(
{},
{
/* eslint-disable-next-line @typescript-eslint/camelcase */
custom_elements: [{ 'content:encoded': node.html }],
title: node.title,
date: node.date,
description: node.description,
guid: site.siteMetadata.siteUrl + node.slug,
url: site.siteMetadata.siteUrl + node.slug
}
)
})
},
title
Expand Down

0 comments on commit e9ccdfa

Please sign in to comment.