Created
May 31, 2021 08:05
-
-
Save swsalim/9c7f29838b05870a618cef358991045d to your computer and use it in GitHub Desktop.
Prismic Link Resolver
This file contains hidden or 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
/** | |
* To learn more about Link Resolving check out the Prismic documentation | |
* https://prismic.io/docs/vuejs/beyond-the-api/link-resolving | |
*/ | |
export default function(doc) { | |
if (doc.isBroken) { | |
return '/not-found' | |
} | |
if (doc.type === 'homepage') { | |
return '/' | |
} | |
if (doc.type === 'page') { | |
return '/page/' + doc.uid | |
} | |
// return '/not-found' | |
return '/' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment