all repos — vite @ cf6acc3b2905bd905bd44805a159e4bb3b6072e6

a fast (this time, actually) and minimal static site generator

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}