mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Ignore dotfiles in content directory
This supports my personal workflow of using vim which places a temporary file in the same directory as the file I'm editing.
This commit is contained in:
@@ -106,7 +106,9 @@ func (site *Site) Render() (err error) {
|
||||
site.timerStep("render shortcodes")
|
||||
site.AbsUrlify()
|
||||
site.timerStep("absolute URLify")
|
||||
site.RenderIndexes()
|
||||
if err = site.RenderIndexes(); err != nil {
|
||||
return
|
||||
}
|
||||
site.RenderIndexesIndexes()
|
||||
site.timerStep("render and write indexes")
|
||||
site.RenderLists()
|
||||
@@ -199,18 +201,25 @@ func (s *Site) initialize() {
|
||||
site.Directories = append(site.Directories, path)
|
||||
return nil
|
||||
} else {
|
||||
if ignoreDotFile(path) {
|
||||
return nil
|
||||
}
|
||||
site.Files = append(site.Files, path)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
filepath.Walk(s.Config.GetAbsPath(s.Config.ContentDir), walker)
|
||||
filepath.Walk(s.absContentDir(), walker)
|
||||
|
||||
s.Info = SiteInfo{BaseUrl: template.URL(s.Config.BaseUrl), Title: s.Config.Title, Config: &s.Config}
|
||||
|
||||
s.Shortcodes = make(map[string]ShortcodeFunc)
|
||||
}
|
||||
|
||||
func ignoreDotFile(path string) bool {
|
||||
return filepath.Base(path)[0] == '.'
|
||||
}
|
||||
|
||||
func (s *Site) absLayoutDir() string {
|
||||
return s.Config.GetAbsPath(s.Config.LayoutDir)
|
||||
}
|
||||
|
Reference in New Issue
Block a user