You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

142 lines
3.6 KiB

/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails react-core
*/
'use strict';
module.exports = {
siteMetadata: {
title: 'React: A JavaScript library for building user interfaces',
siteUrl: 'https://reactjs.org',
rssFeedTitle: 'React',
rssFeedDescription: 'A JavaScript library for building user interfaces',
},
mapping: {
'MarkdownRemark.frontmatter.author': 'AuthorYaml',
},
plugins: [
'gatsby-source-react-error-codes',
'gatsby-transformer-authors-yaml',
'gatsby-plugin-netlify',
'gatsby-plugin-glamor',
'gatsby-plugin-react-next',
'gatsby-plugin-twitter',
{
resolve: 'gatsby-plugin-nprogress',
options: {
color: '#61dafb',
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'packages',
path: `${__dirname}/content/`,
},
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
'gatsby-remark-responsive-iframe',
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 840,
},
},
'gatsby-remark-autolink-headers',
'gatsby-remark-use-jsx',
{
resolve: 'gatsby-remark-prismjs',
options: {
classPrefix: 'gatsby-code-',
},
},
'gatsby-remark-copy-linked-files',
'gatsby-remark-smartypants',
],
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
{
resolve: 'gatsby-plugin-google-analytics',
options: {
trackingId: 'UA-41298772-1',
},
},
{
resolve: 'gatsby-plugin-feed',
options: {
query: `
{
site {
siteMetadata {
title: rssFeedTitle
description: rssFeedDescription
siteUrl
site_url: siteUrl
}
}
}`,
feeds: [
{
serialize: ({query: {site, allMarkdownRemark}}) => {
return allMarkdownRemark.edges.map(edge => {
return Object.assign(
{},
{
title: edge.node.frontmatter.title,
description: edge.node.html,
date: require('moment')(edge.node.fields.date).format(
'MMMM DD, YYYY, h:mm A',
),
url: site.siteMetadata.siteUrl + edge.node.fields.slug,
guid: site.siteMetadata.siteUrl + edge.node.fields.slug,
},
);
});
},
query: `
{
allMarkdownRemark
(limit: 10,
filter: {id: {regex: "/blog/"}},
sort: {fields: [fields___date],
order: DESC}) {
edges {
node {
fields {
date
slug
}
frontmatter {
title
}
html
}
}
}
}
`,
output: '/feed.xml',
},
],
},
},
'gatsby-plugin-react-helmet',
],
};