func (s *Site) sections(src *content.Tree, dst *content.Tree, force bool) error {
	log.Infoln("Checking for sections that no longer exist")
	for name := range dst.Root.Dirs {
		if _, ok := src.Root.Dirs[name]; !ok {
			if err := dst.Root.RemoveAll(name); err != nil {
				return nil
			}
		}
	}
	log.Goodln("DONE")
	log.Infoln("Updating sections")
	for name := range src.Root.Dirs {
		config, ok := s.Config.Sections[name]
		if !ok {
			log.Warnf("Missing config for section %q, skipping", name)
			continue
		}
		section, err := NewSection(s, name, config)
		if err != nil {
			return err
		}
		if err := section.Render(src.Root, dst.Root, force); err != nil {
			return err
		}
	}
	log.Goodln("DONE")
	return nil
}
// sections updates each section of the site as needed
sections updates each section of the site as needed
// sections updates each section of the site as needed
func (s *Site) sections(src *content.Tree, dst *content.Tree, force bool) error {
	log.Infoln("Checking for sections that no longer exist")
	for name := range dst.Root.Dirs {
		if _, ok := src.Root.Dirs[name]; !ok {
			if err := dst.Root.RemoveAll(name); err != nil {
				return nil
			}
		}
	}
	log.Goodln("DONE")
	log.Infoln("Updating sections")
	for name := range src.Root.Dirs {
		config, ok := s.Config.Sections[name]
		if !ok {
			log.Warnf("Missing config for section %q, skipping", name)
			continue
		}
		section, err := NewSection(s, name, config)
		if err != nil {
			return err
		}
		if err := section.Render(src.Root, dst.Root, force); err != nil {
			return err
		}
	}
	log.Goodln("DONE")
	return nil
}
func ( s * Site ) sections ( src * content . Tree , dst * content . Tree , force bool ) error { log . Infoln ( " " ) for name := range dst . Root . Dirs { if _ , ok := src . Root . Dirs [ name ] ; ! ok { if err := dst . Root . RemoveAll ( name ) ; err != nil { return nil } } } log . Goodln ( " " ) log . Infoln ( " " ) for name := range src . Root . Dirs { config , ok := s . Config . Sections [ name ] if ! ok { log . Warnf ( " " , name ) continue } section , err := NewSection ( s , name , config ) if err != nil { return err } if err := section . Render ( src . Root , dst . Root , force ) ; err != nil { return err } } log . Goodln ( " " ) return nil }
sections updates each section of the site as needed
sections updates each section of the site as needed