func (t *Template) Dir() string {
	tokens := strings.Split(t.Path, "/")
	l := len(tokens)
	switch {
	case l < 2:
		return "./"
	default:
		return strings.Join(tokens[:l-1], "/") + "/"
	}
}
Dir returns the template file's directory.
package gold
import (
	"bytes"
	"strings"
)
type Template struct {
	Path      string
	Generator *Generator
	Elements  []*Element
	Super     *Template
	Sub       *Template
	Blocks    map[string]*Block
}
func (t *Template) AppendElement(e *Element) {
	t.Elements = append(t.Elements, e)
}
func (t *Template) Html(stringTemplates map[string]string, embedMap EmbedMap) (string, error) {
	if t.Super != nil {
		return t.Super.Html(stringTemplates, embedMap)
	} else {
		var bf bytes.Buffer
		for _, e := range t.Elements {
			err := e.Html(&bf, stringTemplates)
			if err != nil {
				return "", err
			}
		}
		html := bf.String()
		for key, value := range embedMap {
			html = strings.Replace(html, "%{"+key+"}", value, -1)
		}
		return html, nil
	}
}