fix #260
Showing
1 changed file
with
13 additions
and
0 deletions
| ... | @@ -154,10 +154,23 @@ func getTplDeep(root, file string, t *template.Template) (*template.Template, [] | ... | @@ -154,10 +154,23 @@ func getTplDeep(root, file string, t *template.Template) (*template.Template, [] |
| 154 | if !HasTemplateEXt(m[1]) { | 154 | if !HasTemplateEXt(m[1]) { |
| 155 | continue | 155 | continue |
| 156 | } | 156 | } |
| 157 | if e, _ := FileExists(filepath.Join(root, m[1])); e { | ||
| 157 | t, _, err = getTplDeep(root, m[1], t) | 158 | t, _, err = getTplDeep(root, m[1], t) |
| 158 | if err != nil { | 159 | if err != nil { |
| 159 | return nil, [][]string{}, err | 160 | return nil, [][]string{}, err |
| 160 | } | 161 | } |
| 162 | } else { | ||
| 163 | relativefile := filepath.Join(filepath.Dir(file), m[1]) | ||
| 164 | if e, _ := FileExists(relativefile); e { | ||
| 165 | t, _, err = getTplDeep(root, m[1], t) | ||
| 166 | if err != nil { | ||
| 167 | return nil, [][]string{}, err | ||
| 168 | } | ||
| 169 | } else { | ||
| 170 | panic("can't find template file" + m[1]) | ||
| 171 | } | ||
| 172 | } | ||
| 173 | |||
| 161 | } | 174 | } |
| 162 | } | 175 | } |
| 163 | return t, allsub, nil | 176 | return t, allsub, nil | ... | ... |
-
Please register or sign in to post a comment