Skip to content

Instantly share code, notes, and snippets.

@remainstheday
Created May 26, 2014 23:52
Show Gist options
  • Save remainstheday/42f272ea55289a006bf1 to your computer and use it in GitHub Desktop.
Save remainstheday/42f272ea55289a006bf1 to your computer and use it in GitHub Desktop.
prismic configuration
'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