From b51a41f31f3f5786bd3c78ff125379d8557426fd Mon Sep 17 00:00:00 2001 From: Chiedo Date: Tue, 1 Aug 2017 07:54:50 -0400 Subject: [PATCH] Fallback to frontmatter excerpt if available --- packages/gatsby-plugin-feed/src/gatsby-node.js | 2 +- packages/gatsby-plugin-feed/src/internals.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/gatsby-plugin-feed/src/gatsby-node.js b/packages/gatsby-plugin-feed/src/gatsby-node.js index 6bc0f497e0240..8f406ca32ca80 100644 --- a/packages/gatsby-plugin-feed/src/gatsby-node.js +++ b/packages/gatsby-plugin-feed/src/gatsby-node.js @@ -10,7 +10,7 @@ const serialize = ({ query: { site, allMarkdownRemark } }) => allMarkdownRemark.edges.map(edge => { return { ...edge.node.frontmatter, - description: edge.node.excerpt, + description: edge.node.excerpt || edge.node.frontmatter.excerpt, url: site.siteMetadata.siteUrl + edge.node.fields.slug, guid: site.siteMetadata.siteUrl + edge.node.fields.slug, custom_elements: [{ "content:encoded": edge.node.html }], diff --git a/packages/gatsby-plugin-feed/src/internals.js b/packages/gatsby-plugin-feed/src/internals.js index 3ba843dbe45e7..6dd58a6f6694b 100644 --- a/packages/gatsby-plugin-feed/src/internals.js +++ b/packages/gatsby-plugin-feed/src/internals.js @@ -58,6 +58,7 @@ export const defaultOptions = { node { frontmatter { title + excerpt date } fields {