2018-09-30 11:37:19 +01:00
|
|
|
|
const path = require('path');
|
|
|
|
|
|
2018-11-16 18:22:52 +00:00
|
|
|
|
const {
|
|
|
|
|
buildChallenges,
|
|
|
|
|
replaceChallengeNode,
|
|
|
|
|
localeChallengesRootDir
|
|
|
|
|
} = require('./utils/buildChallenges');
|
2018-09-30 11:37:19 +01:00
|
|
|
|
|
2019-07-25 13:53:42 +05:30
|
|
|
|
const { API_PROXY: proxyUrl = 'http://localhost:3000' } = process.env;
|
2018-10-23 14:18:46 +01:00
|
|
|
|
|
|
|
|
|
const curriculumIntroRoot = path.resolve(__dirname, './src/pages');
|
|
|
|
|
|
2018-08-23 16:29:26 +01:00
|
|
|
|
module.exports = {
|
|
|
|
|
siteMetadata: {
|
2018-09-05 14:00:48 +01:00
|
|
|
|
title: 'freeCodeCamp',
|
|
|
|
|
siteUrl: 'https://www.freecodecamp.org'
|
2018-08-23 16:29:26 +01:00
|
|
|
|
},
|
2018-09-30 12:19:37 +01:00
|
|
|
|
proxy: {
|
|
|
|
|
prefix: '/internal',
|
2019-02-07 01:36:33 +03:00
|
|
|
|
url: proxyUrl
|
2018-09-30 12:19:37 +01:00
|
|
|
|
},
|
2018-08-23 16:29:26 +01:00
|
|
|
|
plugins: [
|
|
|
|
|
'gatsby-plugin-react-helmet',
|
2018-09-04 14:54:23 +01:00
|
|
|
|
{
|
|
|
|
|
resolve: 'gatsby-plugin-create-client-paths',
|
2018-09-13 18:27:14 +01:00
|
|
|
|
options: {
|
|
|
|
|
prefixes: [
|
|
|
|
|
'/certification/*',
|
|
|
|
|
'/unsubscribed/*',
|
|
|
|
|
'/user/*',
|
2018-11-29 12:12:15 +00:00
|
|
|
|
'/settings/*',
|
|
|
|
|
'/n/*'
|
2018-09-13 18:27:14 +01:00
|
|
|
|
]
|
|
|
|
|
}
|
2018-09-04 14:54:23 +01:00
|
|
|
|
},
|
2018-09-30 11:37:19 +01:00
|
|
|
|
{
|
|
|
|
|
resolve: 'fcc-source-challenges',
|
|
|
|
|
options: {
|
|
|
|
|
name: 'challenges',
|
2018-11-16 18:22:52 +00:00
|
|
|
|
source: buildChallenges,
|
|
|
|
|
onSourceChange: replaceChallengeNode,
|
|
|
|
|
curriculumPath: localeChallengesRootDir
|
2018-09-30 11:37:19 +01:00
|
|
|
|
}
|
|
|
|
|
},
|
2018-10-23 14:18:46 +01:00
|
|
|
|
{
|
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
2018-09-30 11:37:19 +01:00
|
|
|
|
options: {
|
|
|
|
|
name: 'introductions',
|
2018-10-23 14:18:46 +01:00
|
|
|
|
path: curriculumIntroRoot
|
2018-09-30 11:37:19 +01:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
resolve: 'gatsby-transformer-remark',
|
|
|
|
|
options: {
|
|
|
|
|
plugins: [
|
2018-10-04 14:47:55 +01:00
|
|
|
|
'gatsby-remark-fcc-forum-emoji',
|
2018-09-30 11:37:19 +01:00
|
|
|
|
{
|
|
|
|
|
resolve: 'gatsby-remark-prismjs',
|
|
|
|
|
options: {
|
|
|
|
|
// Class prefix for <pre> tags containing syntax highlighting;
|
|
|
|
|
// defaults to 'language-' (eg <pre class="language-js">).
|
|
|
|
|
// If your site loads Prism into the browser at runtime,
|
|
|
|
|
// (eg for use with libraries like react-live),
|
|
|
|
|
// you may use this to prevent Prism from re-processing syntax.
|
|
|
|
|
// This is an uncommon use-case though;
|
|
|
|
|
// If you're unsure, it's best to use the default value.
|
|
|
|
|
classPrefix: 'language-',
|
|
|
|
|
// This is used to allow setting a language for inline code
|
|
|
|
|
// (i.e. single backticks) by creating a separator.
|
|
|
|
|
// This separator is a string and will do no white-space
|
|
|
|
|
// stripping.
|
|
|
|
|
// A suggested value for English speakers is the non-ascii
|
|
|
|
|
// character '›'.
|
|
|
|
|
inlineCodeMarker: null,
|
|
|
|
|
// This lets you set up language aliases. For example,
|
|
|
|
|
// setting this to '{ sh: "bash" }' will let you use
|
|
|
|
|
// the language "sh" which will highlight using the
|
|
|
|
|
// bash highlighter.
|
|
|
|
|
aliases: {}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
2018-10-04 14:47:55 +01:00
|
|
|
|
{
|
|
|
|
|
resolve: 'gatsby-remark-node-identity',
|
|
|
|
|
options: {
|
|
|
|
|
identity: 'blockIntroMarkdown',
|
|
|
|
|
predicate: ({ frontmatter }) => {
|
|
|
|
|
if (!frontmatter) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
const { title, block, superBlock } = frontmatter;
|
|
|
|
|
return title && block && superBlock;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
resolve: 'gatsby-remark-node-identity',
|
|
|
|
|
options: {
|
|
|
|
|
identity: 'superBlockIntroMarkdown',
|
|
|
|
|
predicate: ({ frontmatter }) => {
|
|
|
|
|
if (!frontmatter) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
const { title, block, superBlock } = frontmatter;
|
|
|
|
|
return title && !block && superBlock;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2018-08-23 16:29:26 +01:00
|
|
|
|
{
|
|
|
|
|
resolve: 'gatsby-plugin-manifest',
|
|
|
|
|
options: {
|
2018-09-05 14:00:48 +01:00
|
|
|
|
name: 'freeCodeCamp',
|
2018-09-30 11:37:19 +01:00
|
|
|
|
/* eslint-disable camelcase */
|
2018-09-05 14:00:48 +01:00
|
|
|
|
short_name: 'fCC',
|
2018-08-23 16:29:26 +01:00
|
|
|
|
start_url: '/',
|
2018-09-05 14:00:48 +01:00
|
|
|
|
theme_color: '#006400',
|
2018-09-30 11:37:19 +01:00
|
|
|
|
background_color: '#fff',
|
|
|
|
|
/* eslint-enable camelcase */
|
2018-08-23 16:29:26 +01:00
|
|
|
|
display: 'minimal-ui',
|
2018-09-30 11:37:19 +01:00
|
|
|
|
icon: 'src/images/square_puck.png'
|
2018-08-23 16:29:26 +01:00
|
|
|
|
}
|
|
|
|
|
},
|
2019-02-13 17:49:31 +03:00
|
|
|
|
{
|
|
|
|
|
resolve: 'gatsby-plugin-google-fonts',
|
|
|
|
|
options: {
|
|
|
|
|
fonts: ['Lato:400,400i,500']
|
|
|
|
|
}
|
|
|
|
|
},
|
2019-08-14 04:05:44 +05:30
|
|
|
|
'gatsby-plugin-sitemap',
|
|
|
|
|
'gatsby-plugin-remove-fingerprints',
|
|
|
|
|
'gatsby-plugin-remove-serviceworker'
|
2018-08-23 16:29:26 +01:00
|
|
|
|
]
|
2018-09-07 11:06:00 +01:00
|
|
|
|
};
|