formats/anything.go (view raw)
1package formats
2
3import (
4 "path/filepath"
5
6 "git.icyphox.sh/vite/util"
7)
8
9// Anything is a stub format for unrecognized files
10type Anything struct{ Path string }
11
12func (Anything) Ext() string { return "" }
13func (Anything) Frontmatter() map[string]string { return nil }
14func (Anything) Body() string { return "" }
15func (a Anything) Basename() string { return filepath.Base(a.Path) }
16
17func (a Anything) Render(dest string, data interface{}) error {
18 return util.CopyFile(a.Path, dest)
19}