mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
This commit is contained in:
@@ -151,6 +151,10 @@ func (r RootMapping) trimFrom(name string) string {
|
||||
return strings.TrimPrefix(name, r.From)
|
||||
}
|
||||
|
||||
var (
|
||||
_ FilesystemUnwrapper = (*RootMappingFs)(nil)
|
||||
)
|
||||
|
||||
// A RootMappingFs maps several roots into one. Note that the root of this filesystem
|
||||
// is directories only, and they will be returned in Readdir and Readdirnames
|
||||
// in the order given.
|
||||
@@ -200,6 +204,10 @@ func (fs *RootMappingFs) Dirs(base string) ([]FileMetaInfo, error) {
|
||||
return fss, nil
|
||||
}
|
||||
|
||||
func (fs *RootMappingFs) UnwrapFilesystem() afero.Fs {
|
||||
return fs.Fs
|
||||
}
|
||||
|
||||
// Filter creates a copy of this filesystem with only mappings matching a filter.
|
||||
func (fs RootMappingFs) Filter(f func(m RootMapping) bool) *RootMappingFs {
|
||||
rootMapToReal := radix.New()
|
||||
|
Reference in New Issue
Block a user