@@ -709,7 +709,7 @@ func (c *Action) Render(tmpl string, params ...*T) error {
}
//仅生成网页内容
-var regInclude = regexp.MustCompile(`\{\{\s*include\s*"(.*?\.html)"\}\}`)
+var regInclude = regexp.MustCompile(`\{\{\s*include\s*"(.*?\.html)".*\}\}`)
func (c *Action) NamedRender4Cache(name, content string, params ...*T) ([]byte, error) {
c.f["oinclude"] = c.Include
@@ -365,6 +365,9 @@ func newIncludeIntmpl(rootDir string, content []byte) []byte {
b = true
tpl := regInclude.FindSubmatch(m)[1]
fpath := filepath.Join(rootDir, string(tpl))
+ if strings.Contains(string(m), "OUTSIDE") {
+ fpath = string(tpl)
+ }
c, err := ioutil.ReadFile(fpath)
if err != nil {
return []byte{}