Explorar o código

local template path '@' >> '__'

sou %!s(int64=7) %!d(string=hai) anos
pai
achega
76c52984f9
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  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