|
@@ -12,9 +12,9 @@ import (
|
12
|
12
|
)
|
13
|
13
|
|
14
|
14
|
type TemplateSet struct {
|
15
|
|
- members map[string]*Template
|
16
|
|
- Funcs template.FuncMap
|
17
|
|
- contents *TemplateSetContents
|
|
15
|
+ members map[string]*Template
|
|
16
|
+ Funcs template.FuncMap
|
|
17
|
+ bundle *TemplateBundle
|
18
|
18
|
}
|
19
|
19
|
|
20
|
20
|
func NewTemplateSet() *TemplateSet {
|
|
@@ -28,8 +28,8 @@ func (t *TemplateSet) Members() map[string]*Template {
|
28
|
28
|
return t.members
|
29
|
29
|
}
|
30
|
30
|
|
31
|
|
-func (t *TemplateSet) Contents() *TemplateSetContents {
|
32
|
|
- return t.contents
|
|
31
|
+func (t *TemplateSet) Bundle() *TemplateBundle {
|
|
32
|
+ return t.bundle
|
33
|
33
|
}
|
34
|
34
|
|
35
|
35
|
func (t *TemplateSet) AddTemplateFile(name, filename string, templateType int8) error {
|
|
@@ -101,7 +101,7 @@ func (t *TemplateSet) ImportTemplatesFromMap(templateMap map[string]string) erro
|
101
|
101
|
return nil
|
102
|
102
|
}
|
103
|
103
|
|
104
|
|
-func (t *TemplateSet) RenderMember(templateName string, params *RenderParams) {
|
|
104
|
+func (t *TemplateSet) Render(templateName string, params *RenderParams) {
|
105
|
105
|
|
106
|
106
|
t.Members()[templateName].Render(params)
|
107
|
107
|
|
|
@@ -109,9 +109,9 @@ func (t *TemplateSet) RenderMember(templateName string, params *RenderParams) {
|
109
|
109
|
|
110
|
110
|
func (t *TemplateSet) GatherTemplates() {
|
111
|
111
|
|
112
|
|
- contents := NewTemplateSetContents()
|
113
|
|
- contents.importTemplateFileContents()
|
114
|
|
- t.ImportTemplatesFromMap(contents.Items())
|
115
|
|
- t.contents = contents
|
|
112
|
+ bundle := NewTemplateBundle()
|
|
113
|
+ bundle.importTemplateFileContents()
|
|
114
|
+ t.ImportTemplatesFromMap(bundle.Items())
|
|
115
|
+ t.bundle = bundle
|
116
|
116
|
|
117
|
117
|
}
|