feat(admin): make page extensions configurable

This commit is contained in:
NGPixel
2022-06-24 22:20:36 -04:00
parent 18ac9da4c7
commit 48077fc9e5
5 changed files with 55 additions and 30 deletions

View File

@@ -414,7 +414,7 @@ router.get('/_userav/:uid', async (req, res, next) => {
* View document / asset
*/
router.get('/*', async (req, res, next) => {
const stripExt = _.some(WIKI.data.pageExtensions, ext => _.endsWith(req.path, `.${ext}`))
const stripExt = _.some(WIKI.config.pageExtensions, ext => _.endsWith(req.path, `.${ext}`))
const pageArgs = pageHelper.parsePath(req.path, { stripExt })
const isPage = (stripExt || pageArgs.path.indexOf('.') === -1)