Beispiel #1
0
func (s *Site) Build() (err error) {
	if err = s.Process(); err != nil {
		return
	}

	if err = s.Render(); err != nil {
		// Better reporting when the template is missing (commit 2bbecc7b)
		jww.ERROR.Printf("Error rendering site: %s", err)

		jww.ERROR.Printf("Available templates:")
		var keys []string
		for _, template := range s.Tmpl.Templates() {
			if name := template.Name(); name != "" {
				keys = append(keys, name)
			}
		}
		sort.Strings(keys)
		for _, k := range keys {
			jww.ERROR.Printf("\t%s\n", k)
		}

		return
	}

	return nil
}
Beispiel #2
0
func (s *Site) Build() (err error) {
	if err = s.Process(); err != nil {
		return
	}
	if err = s.Render(); err != nil {
		jww.ERROR.Printf("Error rendering site: %s\nAvailable templates:\n", err)
		for _, template := range s.Tmpl.Templates() {
			jww.ERROR.Printf("\t%s\n", template.Name())
		}
		return
	}
	return nil
}
Beispiel #3
0
func (s *Site) Build() (err error) {
	if err = s.Process(); err != nil {
		return
	}
	if err = s.Render(); err != nil {
		// Better reporting when the template is missing (commit 2bbecc7b)
		jww.ERROR.Printf("Error rendering site: %s\nAvailable templates:\n", err)
		for _, template := range s.Tmpl.Templates() {
			jww.ERROR.Printf("\t%s\n", template.Name())
		}
		return
	}
	return nil
}
Beispiel #4
0
func (site *Site) Build() (err error) {
	if err = site.Process(); err != nil {
		return
	}
	if err = site.Render(); err != nil {
		fmt.Printf("Error rendering site: %s\n", err)
		fmt.Printf("Available templates:")
		for _, template := range site.Tmpl.Templates() {
			fmt.Printf("\t%s\n", template.Name())
		}
		return
	}
	site.Write()
	return nil
}