mbanting / metalsmith-prismic

A Metalsmith.io plugin to pull in content from Prismic.io
MIT License
48 stars 19 forks source link

Generation of collection not using custom linkResolver #7

Closed mbanting closed 10 years ago

mbanting commented 10 years ago

@hivearts said

Hello,

Great job!

I have tried and its working wonderful but when i want to use link resolver nothing happen.

.use(prismic({
        "url": "xxxxxxxxxxxxxxxxx",
        "linkResolver": function(doc) {
            return '/news/' + doc.slug;
        }
    }
    ))

Also i have tried your code from test folder.

"linkResolver": function (ctx, doc) {
                    if (doc.isBroken) return false;
                    return '/' + doc.type + '/' + doc.slug + (ctx.maybeRef ? '?ref=' + ctx.maybeRef : '');
                }

And still nothing happen..

It builds always by default linkresolver funcion.

screen shot 2014-08-21 at 14 27 34

mbanting commented 10 years ago

Fixed in 0.4.1.