0 Star 0 Fork 1

xunye/zh-hans.reactjs.org

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gatsby-config.js 4.93 KB
一键复制 编辑 原始数据 按行查看 历史
reactjs-translation-bot 提交于 2020-08-24 15:01 . merging all conflicts
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* @emails react-core
*/
'use strict';
module.exports = {
siteMetadata: {
title: 'React 中文文档: 用于构建用户界面的 JavaScript 库',
siteUrl: 'https://zh-hans.reactjs.org',
rssFeedTitle: 'React',
rssFeedDescription: '用于构建用户界面的 JavaScript 库',
},
mapping: {
'MarkdownRemark.frontmatter.author': 'AuthorYaml',
},
plugins: [
'gatsby-source-react-error-codes',
'gatsby-transformer-authors-yaml',
'gatsby-transformer-home-example-code',
'gatsby-transformer-versions-yaml',
'gatsby-plugin-netlify',
'gatsby-plugin-glamor',
'gatsby-plugin-twitter',
{
resolve: 'gatsby-plugin-nprogress',
options: {
color: '#61dafb',
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'pages',
path: `${__dirname}/src/pages`,
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'content',
path: `${__dirname}/content/`,
},
},
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
'gatsby-remark-responsive-iframe',
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 840,
},
},
'gatsby-remark-external-links',
'gatsby-remark-header-custom-ids',
{
resolve: 'gatsby-remark-code-repls',
options: {
defaultText: '<b>在 CodePen 上尝试</b>',
directory: `${__dirname}/examples/`,
target: '_blank',
codepen: {
redirectTemplate: `${__dirname}/src/templates/codepen-example.js`,
externals: [
`//unpkg.com/react/umd/react.development.js`,
`//unpkg.com/react-dom/umd/react-dom.development.js`,
],
},
},
},
{
resolve: 'gatsby-remark-embed-snippet',
options: {
classPrefix: 'gatsby-code-',
directory: `${__dirname}/examples/`,
},
},
'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: {fileAbsolutePath: {regex: "/blog/"}},
sort: {fields: [fields___date],
order: DESC}) {
edges {
node {
fields {
date
slug
}
frontmatter {
title
}
html
}
}
}
}
`,
output: '/feed.xml',
},
],
},
},
'gatsby-plugin-react-helmet',
'gatsby-plugin-catch-links',
{
resolve: `gatsby-plugin-manifest`,
options: {
name: 'React Docs',
short_name: 'React', // eg. React [%LANG_CODE%]
// Translators: please change this and two above options (see https://www.gatsbyjs.org/packages/gatsby-plugin-manifest/#feature-configuration---optional)
lang: 'en',
start_url: '/',
background_color: '#20232a',
theme_color: '#20232a',
display: 'standalone',
icon: 'static/logo-512x512.png',
legacy: true,
},
},
],
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xunyev2/zh-hans.reactjs.org.git
git@gitee.com:xunyev2/zh-hans.reactjs.org.git
xunyev2
zh-hans.reactjs.org
zh-hans.reactjs.org
main

搜索帮助