grout

package module
v0.0.0-...-646e800 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2013 License: MIT Imports: 19 Imported by: 0

README

Grout

Under development; is technically usable, but nothing at all is set in stone or considered complete. Basically, this was first built for my own uses and is still ongoing.

Grout is a static site generator written in Go, and yes, inspired by Jekyll. Frankly, this came about because of my lack of Ruby knowledge, and my desire to extend Jekyll.

Extensible

Great extensibility is the main goal. Yet, this doesn't happen through plugins. Import Grout to make your own static site generator. It started this way because Go does not yet provide dynamic loading of code, but you'll see this design can be beneficial.

Independent

Whatever environment your site ends up being generated on, it will only need your static site generator executable. Not the Go distribution, and not even Grout itself.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIgnore = errors.New("grout: ignore content")

ErrIgnore is specially handled to allow generation to proceed

Functions

func Build

func Build(input, output string, opt *Options)

func BuildURL

func BuildURL(root, path string) (string, error)

func RegisterGenerator

func RegisterGenerator(name string, gen Generator)

func XMLDate

func XMLDate(t time.Time) string

Types

type Collectable

type Collectable interface {
	Content
	PostRead(data M, collection []Content, i int) error
	Metadata() M
	Less(other Collectable) bool
}

type Content

type Content interface {
	IsDir() bool
	FullPath() string
	Path() string

	Read(data M) error
	Write(dir, cachedir string, data M) error
}

func GeneratePost

func GeneratePost(sitecfg, cfg M, info ContentInfo) (Content, error)

type ContentInfo

type ContentInfo struct {
	os.FileInfo
	// contains filtered or unexported fields
}

func (ContentInfo) FullPath

func (c ContentInfo) FullPath() string

func (ContentInfo) Path

func (c ContentInfo) Path() string

func (*ContentInfo) SetFullPath

func (c *ContentInfo) SetFullPath(p string)

func (*ContentInfo) SetPath

func (c *ContentInfo) SetPath(p string)

type ContentSlice

type ContentSlice []Content

func (ContentSlice) Len

func (c ContentSlice) Len() int

func (ContentSlice) Less

func (c ContentSlice) Less(i, j int) bool

func (ContentSlice) Swap

func (c ContentSlice) Swap(i, j int)

type Dir

type Dir struct {
	ContentInfo
}

func (Dir) Read

func (d Dir) Read(data M) error

func (Dir) Write

func (d Dir) Write(dir, cachedir string, data M) error

type File

type File struct {
	ContentInfo
}

func (File) Read

func (f File) Read(data M) error

func (File) Write

func (f File) Write(dir, cachedir string, data M) error

type Generator

type Generator func(sitecfg, cfg M, info ContentInfo) (Content, error)

type HTMLDocument

type HTMLDocument struct {
	ContentInfo
	FrontMatter M
	Template    *template.Template
}

func (*HTMLDocument) Read

func (d *HTMLDocument) Read(data M) error

func (*HTMLDocument) Write

func (d *HTMLDocument) Write(dir, cachedir string, data M) error

type M

type M map[string]interface{}

func (M) Int

func (m M) Int(path string, def int) int

func (M) Map

func (m M) Map(path string) M

func (M) String

func (m M) String(path string, def string) string

type Options

type Options struct {
	Verbose   bool
	HttpHost  string
	AutoBuild bool
}

type Post

type Post struct {
	*HTMLDocument
	// contains filtered or unexported fields
}

func (*Post) Less

func (p *Post) Less(other Collectable) bool

func (*Post) Metadata

func (p *Post) Metadata() M

func (*Post) PostRead

func (p *Post) PostRead(data M, collection []Content, i int) error

func (*Post) Read

func (p *Post) Read(data M) error

func (*Post) Write

func (p *Post) Write(dir, cachedir string, data M) error

type TextDocument

type TextDocument struct {
	ContentInfo
	FrontMatter M
	Template    *template.Template
}

func (*TextDocument) Read

func (d *TextDocument) Read(data M) error

func (*TextDocument) Write

func (d *TextDocument) Write(dir, cachedir string, data M) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL