From 7a09601a106f1221e2859308639b36b753464464 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 31 May 2019 12:34:30 -0400 Subject: [PATCH] fix: page hands when attempting to create a 2 letters page --- server/helpers/page.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/helpers/page.js b/server/helpers/page.js index 1a134ae5..fcc1387a 100644 --- a/server/helpers/page.js +++ b/server/helpers/page.js @@ -35,7 +35,7 @@ module.exports = { } // Strip extension - if (opts.stripExt) { + if (opts.stripExt && pathParts.length > 0) { const lastPart = _.last(pathParts) if (lastPart.indexOf('.') > 0) { pathParts.pop() @@ -78,7 +78,7 @@ module.exports = { */ isReservedPath(rawPath) { const firstSection = _.head(rawPath.split('/')) - if (firstSection.length === 1) { + if (firstSection.length <= 1) { return true } else if (localeSegmentRegex.test(firstSection)) { return true