mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-08 02:15:49 +01:00
split gatsby-config.js
This commit is contained in:
parent
24057c7d83
commit
584dfade6e
@ -10,8 +10,8 @@ if (!process.env.GITHUB_TOKEN) {
|
||||
`)
|
||||
}
|
||||
|
||||
const path = require('path')
|
||||
const siteConfig = require('./config')
|
||||
const sources = require('./gatsby/sources')
|
||||
|
||||
// required for gatsby-plugin-meta-redirect
|
||||
require('regenerator-runtime/runtime')
|
||||
@ -21,48 +21,7 @@ module.exports = {
|
||||
...siteConfig
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'posts',
|
||||
path: path.join(__dirname, 'content', 'posts')
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'photos',
|
||||
path: path.join(__dirname, 'content', 'photos')
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'media',
|
||||
path: path.join(__dirname, 'content', 'media')
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'images',
|
||||
path: path.join(__dirname, 'src', 'images')
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-graphql',
|
||||
options: {
|
||||
typeName: 'GitHub',
|
||||
fieldName: 'github',
|
||||
url: 'https://api.github.com/graphql',
|
||||
headers: {
|
||||
Authorization: `bearer ${process.env.GITHUB_TOKEN}`
|
||||
},
|
||||
// Additional options to pass to node-fetch
|
||||
fetchOptions: {},
|
||||
refetchInterval: 300 // 5 min.
|
||||
}
|
||||
},
|
||||
...sources,
|
||||
'gatsby-plugin-sharp',
|
||||
'gatsby-transformer-sharp',
|
||||
{
|
||||
|
46
gatsby/sources.js
Normal file
46
gatsby/sources.js
Normal file
@ -0,0 +1,46 @@
|
||||
const path = require('path')
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'posts',
|
||||
path: path.join(__dirname, '..', 'content', 'posts')
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'photos',
|
||||
path: path.join(__dirname, '..', 'content', 'photos')
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'media',
|
||||
path: path.join(__dirname, '..', 'content', 'media')
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-filesystem',
|
||||
options: {
|
||||
name: 'images',
|
||||
path: path.join(__dirname, '..', 'src', 'images')
|
||||
}
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-source-graphql',
|
||||
options: {
|
||||
typeName: 'GitHub',
|
||||
fieldName: 'github',
|
||||
url: 'https://api.github.com/graphql',
|
||||
headers: {
|
||||
Authorization: `bearer ${process.env.GITHUB_TOKEN}`
|
||||
},
|
||||
// Additional options to pass to node-fetch
|
||||
fetchOptions: {},
|
||||
refetchInterval: 300 // 5 min.
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue
Block a user