space

package
v0.0.0-...-7a7d34f Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2014 License: MIT Imports: 12 Imported by: 5

Documentation

Overview

Forked form https://github.com/go-martini/martini/blob/master/env.go

Front-matter: http://jekyllrb.com/docs/frontmatter/

Index

Constants

View Source
const (
	Dev  string = "development"
	Prod string = "production"
	Test string = "test"
)

Envs

Variables

View Source
var (
	FRONT_MATTER = regexp.MustCompile(`---\s*`)
	EOL          = byte('\n')
)
View Source
var Env = Dev

Env is the environment that Space is executing in. The SPACE_ENV is read on initialization to set this variable.

Functions

func FrontMatterParser

func FrontMatterParser(r *bufio.Reader) (contents, metedata *bytes.Buffer, err error)

func Logger

func Logger() mw.Handler

Types

type ClassicSpace

type ClassicSpace struct {
	*Space
	*mw.Ware
}

func Classic

func Classic() *ClassicSpace

type File

type File struct {
	Buffer *bytes.Buffer
	Info   FileInfo
	Page   *Page
	// contains filtered or unexported fields
}

func (*File) Read

func (f *File) Read() (err error)

func (*File) Status

func (f *File) Status(i int)

func (*File) Write

func (f *File) Write() (err error)

func (*File) Written

func (f *File) Written() bool

type FileInfo

type FileInfo os.FileInfo

type FileInfos

type FileInfos map[string]FileInfo

type Files

type Files map[string]*File

type Filesystem

type Filesystem interface {
	Add(FileInfo, string, string)
	Walk(string) FileInfos
	Files() Files
}

func NewFilesystem

func NewFilesystem() Filesystem

type Locals

type Locals map[string]interface{}

type Page

type Page struct {
	Title      string   `yaml:"title"`
	Date       string   `yaml:"date"`
	Type       string   `yaml:"type"`
	Layout     string   `yaml:"layout"`
	Permalink  string   `yaml:"permalink"`
	Draft      bool     `yaml:"draft"`
	Tags       []string `yaml:"tags"`
	Categories []string `yaml:"categories"`
	Next       string   `yaml:"next"`
	Previous   string   `yaml:"previous"`
	Vars       Locals   `yaml:"vars,omitempty"`

	Url          string
	Id           string
	Path         string
	Source       Path
	Target       Path
	NextPage     *Page
	PreviousPage *Page
}

type Pages

type Pages map[string]*Page

type Path

type Path struct {
	Rel string
	Abs string
}

type Processor

type Processor struct {
	inject.Injector
	*mw.Ware
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor() *Processor

func (*Processor) Handle

func (p *Processor) Handle(fs Filesystem)

type Site

type Site struct {
	Title       string
	Url         string
	Source      string
	Destination string
	Time        string
	Author      Locals
	Plugins     Locals
	Tags        []string
	Categories  []string
	Pages       Pages `yaml:"-"`
	Posts       Pages `yaml:"-"`
}

type Space

type Space struct {
	inject.Injector

	Site      *Site
	Processor *Processor
	// contains filtered or unexported fields
}

func New

func New() *Space

func (*Space) Destination

func (s *Space) Destination() string

func (*Space) Dir

func (s *Space) Dir(path string) (err error)

Sets a working directory.

func (*Space) Join

func (s *Space) Join(path ...string) string

func (*Space) Paths

func (s *Space) Paths(path string) FileInfos

func (*Space) Source

func (s *Space) Source() string

Jump to

Keyboard shortcuts

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