Browse Source

fix: getPagePath would include a trailing (#1323) (#1324)

This excludes the trailing slash from the locale code.
alancnet 5 years ago
parent
commit
a457e82b16
1 changed files with 1 additions and 1 deletions
  1. 1 1
      server/helpers/page.js

+ 1 - 1
server/helpers/page.js

@@ -4,7 +4,7 @@ const crypto = require('crypto')
 const path = require('path')
 
 const localeSegmentRegex = /^[A-Z]{2}(-[A-Z]{2})?$/i
-const localeFolderRegex = /^([a-z]{2}(?:-[a-z]{2})?\/)?(.*)/i
+const localeFolderRegex = /^([a-z]{2}(?:-[a-z]{2})?)\/?(.*)/i
 
 const contentToExt = {
   markdown: 'md',