func (e Embed) parse(embeds []*Item) ([]byte, error) {
	funcs := map[string]interface{}{
		"stringify": stringify,
	}
	for i := range e.Funcs {
		funcs[i] = e.Funcs[i]
	}
	tmpl, err := template.New("guark.embed").Funcs(funcs).Parse(e.Template)
	if err != nil {
		return nil, err
	}
	var buff bytes.Buffer
	err = tmpl.Execute(&buff, map[string]interface{}{
		"embeds": embeds,
	})
	if err != nil {
		return nil, err
	}
	return buff.Bytes(), nil
}
Parse embed template and return bytes.
package embed
import (
	"bytes"
	"compress/gzip"
	"fmt"
	"io/ioutil"
	"runtime"
	"strings"
	"text/template"
	"github.com/guark/guark/utils"
)
type (
	Item struct {
		ID   string
		Path string
		Data []byte
	}
	Embed struct {
		Root     string
		Template string
		Funcs    map[string]func(file string, data []byte) string
	}
)
func (e Embed) Build(files []string) ([]byte, error) {
	var (
		err    error
		data   []byte
		embeds []*Item
	)
	for i := range files {
		if utils.IsDir(files[i]) {
			continue
		}
		if data, err = ioutil.ReadFile(files[i]); err != nil {
			return nil, err
		}
		var gzdata bytes.Buffer
		w := gzip.NewWriter(&gzdata)
		w.Write(data)
		w.Close()
		id := strings.Replace(files[i], e.Root, "", 1)
		if runtime.GOOS == "windows" {
			id = strings.Replace(id, `\`, "/", -1)
		}
		embeds = append(embeds, &Item{
			ID:   id,
			Path: files[i],
			Data: gzdata.Bytes(),
		})
	}
	return e.parse(embeds)
}