all repos — vite @ master

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

types/types.go (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
package types

const (
	BuildDir     = "build"
	PagesDir     = "pages"
	TemplatesDir = "templates"
	StaticDir    = "static"
)

type File interface {
	Ext() string
	// Render takes any arbitrary data and combines that with the global config,
	// page frontmatter and the body, as template params. Templates are read
	// from types.TemplateDir and the final html is written to dest,
	// with necessary directories being created.
	Render(dest string, data interface{}) error

	// Frontmatter will not be populated if Render hasn't been called.
	Frontmatter() map[string]string
	// Body will not be populated if Render hasn't been called.
	Body() string
	Basename() string
}

// Only used for building indexes and Atom feeds
type Post struct {
	Meta map[string]string
	// HTML-formatted body of post
	Body string
}