Documentation
¶
Index ¶
- func Build() int
- func BuildIndex(dir string, nodes []*Node, current *Current)
- func Clean()
- func CompileAsset(config *Config)
- func CompileNodes(db *NodeDB)
- func CreateNode(dir, title string) error
- func FuncMaps() template.FuncMap
- func Run(addr, public string)
- func Serve(addr, directory string) int
- func Setup(name string) error
- func Watch(dir string) (*fsnotify.Watcher, error)
- type Config
- type Current
- type ListPage
- type Node
- type NodeDB
- type NodeMeta
- type Server
- type Site
- type SiteConfig
- type Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build() int
Build executes template and content to generate our real static conent
func BuildIndex ¶
func CompileAsset ¶ added in v0.0.2
func CompileAsset(config *Config)
CompileAsset copy asset from theme or static into public and also generate a hash version of those file
func CompileNodes ¶ added in v0.0.2
func CompileNodes(db *NodeDB)
func CreateNode ¶
Types ¶
type Config ¶
type Config struct {
Theme string `"yaml":theme`
Site string `"yaml":site`
// contains filtered or unexported fields
}
func DefaultConfig ¶
func DefaultConfig() *Config
type Current ¶ added in v0.0.2
Current is a struct about various current state we pass to template to help us do some business logic depend on a context
type ListPage ¶ added in v0.0.2
type ListPage struct {
Current *Current
Title string
Permalink string
Nodes []map[string]interface{}
}
ListPage is an index page, it isn't constructed from a markdown file but from a list of related markdown such as tag or category
type Node ¶
type Node struct {
Meta *NodeMeta
Body template.HTML
Name string // the filename without extension
Raw string
Path string
BaseDirectory string // the directory without /content part
// contains filtered or unexported fields
}
Node hold information of a specifc page we are rendering
type NodeDB ¶
NodeDB is the in-memory database of all the page
func (*NodeDB) ByCategory ¶ added in v0.0.2
ByTag category groups node by category(category is the directoy name)
func (*NodeDB) Publishable ¶ added in v0.0.2
Publishable returns a list of node that can be publish, as in non-draft mode or non page
type NodeMeta ¶
type NodeMeta struct {
Title string
Draft bool
Date time.Time
DateFormatted string
Tags []string
Category string
Type string
}
NodeMeta is meta data of a node, usually map directly to node toml metadata section
type Site ¶
type Site struct {
Name string
Author string
BaseUrl string
Config *SiteConfig
}
Site stores information of this static site and various meta data
type SiteConfig ¶
type Theme ¶ added in v0.0.4
type Theme struct {
Name string
// contains filtered or unexported fields
}