Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gatsby Config
module.exports = {
siteMetadata: {
title: "Lisi Linhart",
description: "Lisi Linharts Portfolio & Blog",
author: "Lisi Linhart",
siteUrl: "https://lisilinhart.info"
},
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/pages/`,
name: "pages",
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/posts/`,
name: `posts`,
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 590,
},
},
{
resolve: `gatsby-remark-responsive-iframe`,
options: {
wrapperStyle: `margin-bottom: 1.0725rem`,
},
},
{
resolve: `gatsby-remark-prismjs`,
options: {
aliases: {},
},
},
"gatsby-remark-copy-linked-files",
"gatsby-remark-smartypants",
"gatsby-remark-component",
],
},
},
`gatsby-transformer-javascript-frontmatter`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-google-analytics`,
options: {
anonymize: true,
respectDNT: true,
trackingId: `UA----`,
},
},
`gatsby-plugin-offline`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-feed`,
options: {
query: `
{
site {
siteMetadata {
title
description
siteUrl
site_url: siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, allMarkdownRemark } }) => {
return allMarkdownRemark.edges.map(edge => {
return Object.assign({}, edge.node.frontmatter, {
description: edge.node.excerpt,
url: site.siteMetadata.siteUrl + edge.node.fields.slug,
guid: site.siteMetadata.siteUrl + edge.node.fields.slug,
custom_elements: [{ "content:encoded": edge.node.html }]
});
});
},
query: `
{
allMarkdownRemark(
limit: 1000,
sort: { order: DESC, fields: [frontmatter___date] },
filter: { id: { regex: "//posts//" } }
) {
edges {
node {
excerpt
html
fields {
slug
}
frontmatter {
title
date
}
}
}
}
}
`,
output: "/rss.xml"
}
]
},
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment