Closed raduchiriac closed 8 years ago
Have you tried one of the following:
ignore: ['/artist/admin']
or
ignore: ['^.(\bartist\/admin\b)?$']
Nope they don't. The problem is that at line 61 you are checking the pure dynamic routes with that regex, which does a match between:
"/artist/:name".match('artist/admin');
This will never match.
You should do the ignore test inside the addListRoutes()
too.
If you tell me how to go about, I could start writing a PR
In the case you are trying to solve for, is "admin" the name of one of the artists you have stored in Keystone, or is it a custom route that you have declared separately? If it is the name of an artist, you might be able to use the filters
option like so:
app.get('/sitemap.xml', function(req, res) {
sitemap.create(keystone, req, res, {
filters: {
'Artist': function(artist) {
return artist.name.toLowerCase() !== 'admin';
}
}
});
});
If not, let me know how the artists/admin route is being generated and I will look into adding a filter in the addListRoutes function.
That is exactly it, filters
are great. Thank you!
(Probably not an issue but) I am trying to ignore one specific route from a set of others. I am using:
I want to ignore
artist/admin
and I have tried this below but did succeeded