Created
May 26, 2014 23:52
-
-
Save remainstheday/42f272ea55289a006bf1 to your computer and use it in GitHub Desktop.
prismic configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
exports.Configuration = { | |
apiEndpoint: 'https://trinet.prismic.io/api', | |
// -- Links resolution rules | |
linkResolver: function(ctx, doc) { | |
if (doc.isBroken) return false; | |
if(doc.type == 'blog' && !doc.isBroken) { | |
return '/blog/posts/' + doc.id + '/' + doc.slug + (ctx.maybeRef ? '?ref=' + ctx.maybeRef : ''); | |
} | |
}, | |
// -- What to do in the event of an error from prismic.io | |
onPrismicError: function(err, req, res) { | |
res.send(500, 'Error 500: ' +err.message); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment