mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
parent
24ad429571
commit
901077c036
1 changed files with 6 additions and 5 deletions
|
@ -837,15 +837,16 @@ type contentChangeMap struct {
|
|||
symContent map[string]map[string]bool
|
||||
}
|
||||
|
||||
func (m *contentChangeMap) add(filename string, tp bundleDirType) {
|
||||
func (m *contentChangeMap) add(dirname string, tp bundleDirType) {
|
||||
m.mu.Lock()
|
||||
dir := filepath.Dir(filename) + helpers.FilePathSeparator
|
||||
dir = strings.TrimPrefix(dir, ".")
|
||||
if !strings.HasSuffix(dirname, helpers.FilePathSeparator) {
|
||||
dirname += helpers.FilePathSeparator
|
||||
}
|
||||
switch tp {
|
||||
case bundleBranch:
|
||||
m.branchBundles[dir] = true
|
||||
m.branchBundles[dirname] = true
|
||||
case bundleLeaf:
|
||||
m.leafBundles.Insert(dir, true)
|
||||
m.leafBundles.Insert(dirname, true)
|
||||
default:
|
||||
panic("invalid bundle type")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue