Skip to content

Commit

Permalink
Configure repository from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
raulg committed Apr 12, 2019
1 parent 6c723be commit 990d369
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const { apiEndpoint } = require('./prismic-configuration');
var repo = /([^\/]+)\.prismic\.io\/api\/v2/.exec(apiEndpoint);

module.exports = {
siteMetadata: {
title: `Coffee Shop Demo`,
Expand All @@ -9,9 +12,10 @@ module.exports = {
{
resolve: `gatsby-source-prismic-graphql`,
options: {
repositoryName: `prismic-gatsby-coffee`,
repositoryName: repo[1],
path: '/preview',
previews: true,
//accessToken: '...',
pages: [{
type: 'Product',
match: '/products/:uid',
Expand Down
4 changes: 4 additions & 0 deletions prismic-configuration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
apiEndpoint: 'https://prismic-gatsby-coffee.prismic.io/api/v2',
// accessToken: '###########',
};

0 comments on commit 990d369

Please sign in to comment.