all repos — vite @ 81b8a3faf63f5b53e9d6e95aa09149941c4a2f11

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{}, drafts bool) error {
18	return util.CopyFile(a.Path, dest)
19}