Beispiel #1
0
Datei: gone.go Projekt: fxnn/gone
func createLoader(contentRoot gopath.GoPath, cfg config.Config) templates.Loader {
	var templatePath = templatePath(contentRoot, cfg)

	if !templatePath.IsEmpty() {
		return templates.NewFilesystemLoader(templatePath)
	}

	return templates.NewStaticLoader()
}
Beispiel #2
0
Datei: gone.go Projekt: fxnn/gone
func exportTemplates(cfg config.Config) {
	var target = templatePath(contentRoot(), cfg)
	if target.IsEmpty() {
		target = contentRoot().JoinPath(defaultTemplateDirectoryName)
	}

	if err := templates.NewStaticLoader().WriteAllTemplates(target); err != nil {
		log.Fatalf("error exporting templates: %s", err)
	}
}
Beispiel #3
0
func createSut(s store.Store) *Editor {
	var l = templates.NewStaticLoader()
	return New(l, s)
}