mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
b959ecbc81
commit
64e1613fb3
3 changed files with 10 additions and 4 deletions
|
@ -62,7 +62,7 @@ includeFiles = "/mydata/**"
|
||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source = 'assets'
|
source = 'assets'
|
||||||
target = 'assets'
|
target = 'assets'
|
||||||
excludeFiles = "/**exclude.*"
|
excludeFiles = ["/**exclude.*", "/moooo.*"]
|
||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source = 'i18n'
|
source = 'i18n'
|
||||||
target = 'i18n'
|
target = 'i18n'
|
||||||
|
|
|
@ -149,13 +149,13 @@ func (m *ModulesConfig) finalize(logger loggers.Logger) error {
|
||||||
|
|
||||||
func filterUnwantedMounts(mounts []Mount) []Mount {
|
func filterUnwantedMounts(mounts []Mount) []Mount {
|
||||||
// Remove duplicates
|
// Remove duplicates
|
||||||
seen := make(map[Mount]bool)
|
seen := make(map[string]bool)
|
||||||
tmp := mounts[:0]
|
tmp := mounts[:0]
|
||||||
for _, m := range mounts {
|
for _, m := range mounts {
|
||||||
if !seen[m] {
|
if !seen[m.key()] {
|
||||||
tmp = append(tmp, m)
|
tmp = append(tmp, m)
|
||||||
}
|
}
|
||||||
seen[m] = true
|
seen[m.key()] = true
|
||||||
}
|
}
|
||||||
return tmp
|
return tmp
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ package modules
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -386,6 +387,11 @@ type Mount struct {
|
||||||
ExcludeFiles interface{}
|
ExcludeFiles interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used as key to remove duplicates.
|
||||||
|
func (m Mount) key() string {
|
||||||
|
return path.Join(m.Lang, m.Source, m.Target)
|
||||||
|
}
|
||||||
|
|
||||||
func (m Mount) Component() string {
|
func (m Mount) Component() string {
|
||||||
return strings.Split(m.Target, fileSeparator)[0]
|
return strings.Split(m.Target, fileSeparator)[0]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue