-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
@jmooring asked me to create this proposal as a result of the discussion in that thread: https://discourse.gohugo.io/t/please-make-taxonomy-bycount-produce-a-stable-ordering/56149
Currently, when Hugo cleans the destination directory, it uses a filter defined in commands/hugobuilder.go as follows:
syncer.DeleteFilter = func(f fsync.FileInfo) bool {
return f.IsDir() && strings.HasPrefix(f.Name(), ".")
}So, it refrains from deleting directories prefixed with a dot.
This means that it will spare my .git directory, but it won't spare my .gitignore file. So, my .gitignore file gets deleted on every single hugo build, which is a bummer.
This is a proposal to extend the filter a bit.
@jmooring suggests that the filter should additionally spare the .gitignore and .gitattributes files only.
I think it would be better to simply get rid of the f.isDir() && part so that the filter spares anything prefixed with a dot.