Adding extra paths to not allow slugs for

This commit is contained in:
Hannah Wolfe 2013-09-16 21:17:14 +01:00
parent 8c76706bb0
commit 8c26249d46

View File

@ -121,7 +121,7 @@ GhostBookshelf.Model = GhostBookshelf.Model.extend({
// Remove trailing hypen // Remove trailing hypen
slug = slug.charAt(slug.length - 1) === '-' ? slug.substr(0, slug.length - 1) : slug; slug = slug.charAt(slug.length - 1) === '-' ? slug.substr(0, slug.length - 1) : slug;
// Check the filtered slug doesn't match any of the reserved keywords // Check the filtered slug doesn't match any of the reserved keywords
slug = /^(ghost|ghost\-admin|admin|wp\-admin|dashboard|login|archive|archives|category|categories|tag|tags|page|pages|post|posts|user|users)$/g slug = /^(ghost|ghost\-admin|admin|wp\-admin|wp\-login|dashboard|logout|login|signin|signup|signout|register|archive|archives|category|categories|tag|tags|page|pages|post|posts|user|users)$/g
.test(slug) ? slug + '-post' : slug; .test(slug) ? slug + '-post' : slug;
//if slug is empty after trimming use "post" //if slug is empty after trimming use "post"