瀏覽代碼

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

This excludes the trailing slash from the locale code.
alancnet 5 年之前
父節點
當前提交
a457e82b16
共有 1 個文件被更改,包括 1 次插入1 次删除
  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',