package www import ( "io/fs" "testing/fstest" ) // FS presents a tree Pages returned as a file system, so site.Build // can take it where it takes a directory. Every entry is a regular // file with mode 0644, the mode cmd/fiesta writes files with, and // the directories between are implied by the paths. func FS(m map[string][]byte) fs.FS { out := make(fstest.MapFS, len(m)) for name, data := range m { out[name] = &fstest.MapFile{Data: data, Mode: 0o644} } return out }