func (s *Section) Render(src, dst *content.Dir, force bool) (err error) {
	srcDir := src.Subs[s.name]
	dstDir, ok := dst.Subs[s.name]
	if !ok {
		if _, err = dstDir.Mkdir(s.name); err != nil {
			return err
		}
		sub, err := content.NewDir(filepath.Join(dstDir.Path, s.name))
		if err != nil {
			return err
		}
		dstDir.Subs[s.name] = sub
	}
	for name := range dstDir.Dirs {
		if s.Config.HasCategory(name) {
			continue
		}
		if _, ok := srcDir.Dirs[name]; ok {
			continue
		}
		if err = dstDir.RemoveAll(name); err != nil {
			return
		}
	}
	if err = s.renderCategories(srcDir, dstDir, force); err != nil {
		return
	}
	dir, err := NewSectionDir(s)
	if err != nil {
		return err
	}
	return dir.Render(srcDir, dstDir, force)
}
// Render updates the contents of a destination tree from a source tree, for a given Section
Render updates the contents of a destination tree from a source tree, for a given Section
// Render updates the contents of a destination tree from a source tree for a given Section
func (s *Section) Render(src, dst *content.Dir, force bool) (err error) {
	srcDir := src.Subs[s.name]
	dstDir, ok := dst.Subs[s.name]
	if !ok {
		if _, err = dstDir.Mkdir(s.name); err != nil {
			return err
		}
		sub, err := content.NewDir(filepath.Join(dstDir.Path, s.name))
		if err != nil {
			return err
		}
		dstDir.Subs[s.name] = sub
	}
	for name := range dstDir.Dirs {
		if s.Config.HasCategory(name) {
			continue
		}
		if _, ok := srcDir.Dirs[name]; ok {
			continue
		}
		if err = dstDir.RemoveAll(name); err != nil {
			return
		}
	}
	if err = s.renderCategories(srcDir, dstDir, force); err != nil {
		return
	}
	dir, err := NewSectionDir(s)
	if err != nil {
		return err
	}
	return dir.Render(srcDir, dstDir, force)
}
func ( s * Section ) Render ( src , dst * content . Dir , force bool ) ( err error ) { srcDir := src . Subs [ s . name ] dstDir , ok := dst . Subs [ s . name ] if ! ok { if _ , err = dstDir . Mkdir ( s . name ) ; err != nil { return err } sub , err := content . NewDir ( filepath . Join ( dstDir . Path , s . name ) ) if err != nil { return err } dstDir . Subs [ s . name ] = sub } for name := range dstDir . Dirs { if s . Config . HasCategory ( name ) { continue } if _ , ok := srcDir . Dirs [ name ] ; ok { continue } if err = dstDir . RemoveAll ( name ) ; err != nil { return } } if err = s . renderCategories ( srcDir , dstDir , force ) ; err != nil { return } dir , err := NewSectionDir ( s ) if err != nil { return err } return dir . Render ( srcDir , dstDir , force ) }
Render updates the contents of a destination tree from a source tree, for a given Section
Render updates the contents of a destination tree from a source tree for a given Section