Documentation
¶
Index ¶
- func After(fn Handler)
- func AssembleSource(ctx *Context)
- func Before(fn Handler)
- func Build(ctx *Context)
- func CleanCopied(ctx *Context) error
- func Compile(ctx *Context)
- func Copy(ctx *Context)
- func CopyMedia(ctx *Context) error
- func CopyMust(ctx *Context) error
- func CopyStatic(ctx *Context) error
- func Counter() int
- func Read(ctx *Context)
- func ReadLang(srcDir string) (map[string]*helper.I18n, error)
- func ReadMeta(srcDir string) (*model.MetaAll, error)
- func ReadPages(srcDir string) ([]*model.Page, error)
- func ReadPosts(srcDir string) ([]*model.Post, error)
- func ReadSource(ctx *Context)
- func ReadTheme(ctx *Context)
- func Watch(ctx *Context)
- type Builder
- type Context
- type CopiedOpt
- type Handler
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssembleSource ¶
func AssembleSource(ctx *Context)
AssembleSource assemble some extra data in Source, such as page nodes, i18n status. it need be used after posts and pages are loaded
func Build ¶
func Build(ctx *Context)
Build do a process with Context. the context should be prepared before building.
func CopyStatic ¶
CopyStatic copy static assets from theme to destination directory
func Read ¶
func Read(ctx *Context)
Read do a process to read Source with Context. It does not build any thing, just read source data.
func ReadSource ¶
func ReadSource(ctx *Context)
ReadSource read source with *Context. parse *Context.From and read data to *Context.Source
Types ¶
type Builder ¶
type Builder struct {
IsBuilding bool
IsWatching bool
Counter int
// contains filtered or unexported fields
}
Builder is object of Builder handlers
type Context ¶
type Context struct {
// From is source origin
From string
// To is destination
To string
// Theme is theme origin
ThemeName string
// Err is error when context using
Err error
// Source is sources data
Source *Source
// Theme is theme object, use to render templates
Theme *theme.Theme
// Files is generated files in by this context
Files *model.Files
// Tree is url tree nodes by this context
Tree *model.Tree
Copied *CopiedOpt
// contains filtered or unexported fields
}
Context obtain context in once building process
func NewContext ¶
NewContext create new Context with from,to and theme args
type CopiedOpt ¶
type CopiedOpt struct {
MustFiles []string
IgnoreDir []string
IgnoreFile []string
CleanIgnoreDir []string
CleanIgnoreFile []string
}
CopiedOpt set option when copying files to destination
type Source ¶
type Source struct {
Meta *model.Meta
Owner *model.Author
Authors map[string]*model.Author
Comment *model.Comment
Analytics *model.Analytics
I18n map[string]*helper.I18n
Posts model.Posts
PostPage int
Archive []*model.Archive
Pages model.Pages
Tags map[string]*model.Tag
// contains filtered or unexported fields
}
Source include all sources data