Просмотр исходного кода

local template path '@' >> '__'

sou 8 лет назад
Родитель
Сommit
76c52984f9
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      lib/models/page.js

+ 3 - 3
lib/models/page.js

@@ -530,7 +530,7 @@ module.exports = function(crowi) {
   // find all templates applicable to the new page
   pageSchema.statics.findTemplate = function(pathList, templatePath) {
     const Page = this;
-    const regexpList = pathList.map(path => new RegExp(`${path}/[_@]template`));
+    const regexpList = pathList.map(path => new RegExp(`${path}/_{1,2}template`));
 
     return Page
       .find({path: {$in: regexpList}})
@@ -571,9 +571,9 @@ module.exports = function(crowi) {
     let templateBody;
     /**
      * get local template
-     * @tempate: applicable only to immediate decendants
+     * __tempate: applicable only to immediate decendants
      */
-    const localTemplate = assignTemplateByType(templates, templatePath, '@');
+    const localTemplate = assignTemplateByType(templates, templatePath, '__');
 
     /**
      * get global templates