code: func (p *Engine) LoadDirectory(dir string, extension string) (templateErr error) {
  	fsLoader, err := pongo2.NewLocalFileSystemLoader(dir) // I see that this doesn't read the content if already parsed, so do it manually via filepath.Walk
  	if err != nil {
  		return err
  	}
  
  	set := pongo2.NewSet("", fsLoader)
  	set.Globals = getPongoContext(p.Config.Globals)
  
  	// set the filters
  	filters := p.convertFilters()
  	for filterName, filterFunc := range filters {
  		pongo2.RegisterFilter(filterName, filterFunc)
  	}
  
  	p.mu.Lock()
  	defer p.mu.Unlock()
  
  	// Walk the supplied directory and compile any files that match our extension list.
  	filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
  		// Fix same-extension-dirs bug: some dir might be named to: "users.tmpl", "local.html".
  		// These dirs should be excluded as they are not valid golang templates, but files under
  		// them should be treat as normal.
  		// If is a dir, return immediately (dir is not a valid golang template).
  		if info == nil || info.IsDir() {
  
  		} else {
  
  			rel, err := filepath.Rel(dir, path)
  			if err != nil {
  				templateErr = err
  				return err
  			}
  
  			ext := filepath.Ext(rel)
  			if ext == extension {
  
  				buf, err := ioutil.ReadFile(path)
  				if err != nil {
  					templateErr = err
  					return err
  				}
  				name := filepath.ToSlash(rel)
  
  				p.templateCache[name], templateErr = set.FromString(string(buf))
  
  				if templateErr != nil && p.Config.DebugTemplates {
  					p.templateCache[name], _ = set.FromString(
  						fmt.Sprintf(templateErrorMessage, templateErr.Error()))
  				}
  			}
  
  		}
  		return nil
  	})
  
  	return
  }
docs: // LoadDirectory builds the templates