mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
tpl: Prepare for template metrics
This commit is contained in:
@@ -68,6 +68,14 @@ type TemplateAdapter struct {
|
||||
Template
|
||||
}
|
||||
|
||||
// Execute executes the current template. The actual execution is performed
|
||||
// by the embedded text or html template, but we add an implementation here so
|
||||
// we can add a timer for some metrics.
|
||||
func (t *TemplateAdapter) Execute(w io.Writer, data interface{}) error {
|
||||
// TODO(moorereason) metrics fmt.Println("Execute:", t.Name())
|
||||
return t.Template.Execute(w, data)
|
||||
}
|
||||
|
||||
// ExecuteToString executes the current template and returns the result as a
|
||||
// string.
|
||||
func (t *TemplateAdapter) ExecuteToString(data interface{}) (string, error) {
|
||||
|
Reference in New Issue
Block a user