code: func setup(c *caddy.Controller) error {
  	rules, err := templatesParse(c)
  	if err != nil {
  		return err
  	}
  
  	cfg := httpserver.GetConfig(c)
  
  	tmpls := Templates{
  		Rules:   rules,
  		Root:    cfg.Root,
  		FileSys: http.Dir(cfg.Root),
  	}
  
  	cfg.AddMiddleware(func(next httpserver.Handler) httpserver.Handler {
  		tmpls.Next = next
  		return tmpls
  	})
  
  	return nil
  }
docs: // setup configures a new Templates middleware instance.