gatsby-starter-prismic
gatsby-starter-prismic copied to clipboard
Anyone know how to setup this starter with gatsby-plugin-feed properly?
This is still work in progress, as i experience difficulties hooking up the slicezone with the feed custom content part. Great if there are anyone to help!
{
resolve: "gatsby-plugin-feed",
options: {
setup(ref) {
const ret = ref.query.site.siteMetadata;
ret.allPrismicPost = ref.query.allPrismicPost;
ret.generator = "GatsbyJS Material Starter";
return ret;
},
query: `
{
site {
siteMetadata {
author
siteUrl
title
description
}
}
}
`,
feeds: [
{
serialize(ctx) {
const { rssMetadata } = ctx.query.site.siteMetadata;
return ctx.query.allPrismicPost.edges.map(edge => ({
date: edge.node.data.date,
title: edge.node.data.title.text,
description: edge.node.data.body[0].primary.text.text,
}));
},
query: `
{
allPrismicPost(sort: { fields: [data___date], order: DESC }) {
edges {
node {
uid
data {
feature {
url
localFile {
childImageSharp {
sizes(maxWidth: 1280) {
aspectRatio
src
srcSet
srcWebp
srcSetWebp
sizes
}
}
}
}
title {
text
}
url {
url
}
body {
... on PrismicPostBodyText {
slice_type
id
primary {
text {
html
text
}
}
}
}
date(formatString: "DD.MM.YYYY")
}
}
}
}
}
`,
output: "/rss.xml",
title: "Your Site's RSS Feed",
}
]
},
},```
Were you able to figure it out yourself or do you need guidance?
I'm still stuck in mapping the slice-zone. Guidance is appreciated! much thanks!!