Documentation ¶
Index ¶
- func After(fn Handler)
- func AssembleSource(ctx *Context)
- func Before(fn Handler)
- func Build(ctx *Context)
- func Compile(ctx *Context)
- func Counter() int
- func Read(ctx *Context)
- func ReadLang(srcDir string) map[string]*helper.I18n
- func ReadPages(ctx *Context) ([]*model.Page, error)
- func ReadPosts(ctx *Context) ([]*model.Post, error)
- func ReadSecondMeta(srcDir string) (*model.MetaAll, error)
- func ReadSource(ctx *Context)
- func ReadTheme(ctx *Context)
- func Sync(ctx *Context)
- func Watch(ctx *Context)
- type Builder
- type Context
- func (ctx *Context) Again()
- func (ctx *Context) Cli() *cli.Context
- func (ctx *Context) DstDir() string
- func (ctx *Context) Duration() float64
- func (ctx *Context) IsValid() bool
- func (ctx *Context) SrcDir() string
- func (ctx *Context) SrcLangDir() string
- func (ctx *Context) SrcMediaDir() string
- func (ctx *Context) SrcPageDir() string
- func (ctx *Context) SrcPostDir() string
- func (ctx *Context) View() map[string]interface{}
- 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 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 ReadSecondMeta ¶
ReadSecondMeta read meta file in srcDir
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 // Tree is url tree nodes by this context Tree *model.Tree // Sync is file syncer Sync *sync.Syncer // contains filtered or unexported fields }
Context obtain context in once building process
func NewContext ¶
NewContext create new Context with from,to and theme args
func (*Context) SrcLangDir ¶
SrcLangDir get language dir in src
func (*Context) SrcMediaDir ¶
SrcMediaDir get media dir in src
type Source ¶
type Source struct { Meta *model.Meta Owner *model.Author Authors map[string]*model.Author Comment *model.Comment Analytics *model.Analytics Build *model.Build I18n map[string]*helper.I18n Posts model.Posts PagePosts map[int]*model.PagerPosts IndexPosts model.PagerPosts // same to PagePosts[1] PostPage int Archive model.Archives Pages model.Pages Tags map[string]*model.Tag TagPosts map[string]*model.TagPosts }
Source include all sources data