Documentation
¶
Index ¶
Constants ¶
View Source
const ( // SourceOpPost means source item is a post SourceOpPost = 1 // SourceOpPage means source item is a page SourceOpPage = 3 // SourceOpFile means source item is a common file SourceOpFile = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analytics ¶
type Analytics struct { Baidu string `toml:"baidu" ini:"baidu"` Google string `toml:"google" ini:"google"` Tencent string `toml:"tencent" ini:"tencent"` Cnzz string `toml:"cnzz" ini:"cnzz"` }
Analytics is third-party analytics settings for site
type Author ¶
type Author struct { Name string `toml:"name" ini:"name"` Nick string `toml:"nick" ini:"nick"` Email string `toml:"email" ini:"email"` URL string `toml:"url" ini:"url"` }
Author is author info
type Comment ¶
type Comment struct {
Disqus string `toml:"disqus" ini:"disqus"`
}
Comment is comment settings for site
type Config ¶
type Config struct { Meta *Meta `toml:"meta" ini:"meta"` Authors AuthorGroup `toml:"author" ini:"author"` Comment *Comment `toml:"comment" ini:"comment"` Analytics *Analytics `toml:"analytics" ini:"analytics"` SrcFile string `toml:"-" ini:"-"` }
Config is all config from config file
type ContentIndex ¶
type ContentIndex struct { Level int Title string Archor string Children []*ContentIndex Link string Parent *ContentIndex }
ContentIndex is index of content
func NewContentIndex ¶
func NewContentIndex(r io.Reader) []*ContentIndex
NewContentIndex parse reader byte to index
type Meta ¶
type Meta struct { Title string `toml:"title" ini:"title"` Subtitle string `toml:"subtitle" ini:"subtitle"` Keyword string `toml:"keyword" ini:"keyword"` Desc string `toml:"desc" ini:"desc"` Domain string `toml:"domain" ini:"domain"` Root string `toml:"root" ini:"root"` Lang string `toml:"lang" ini:"lang"` }
Meta is metadata info for site
type Page ¶
type Page struct { Title string `toml:"title" ini:"title"` Slug string `toml:"slug" ini:"slug"` Desc string `toml:"desc" ini:"desc"` CreateString string `toml:"date" ini:"date"` UpdateString string `toml:"update_date" ini:"update_date"` AuthorName string `toml:"author" ini:"author"` Template string `toml:"template" ini:"template"` Lang string `toml:"lang" ini:"lang"` Meta map[string]interface{} `toml:"meta" ini:"-"` Sort int `toml:"sort" ini:"sort"` Author *Author `toml:"-" ini:"-"` Draft bool `toml:"draft" ini:"draft"` Index []*ContentIndex `toml:"-" ini:"-"` MetaFormat string `toml:"-" ini:"-"` SourceFile string `toml:"-" ini:"-"` SourceRelpath string `toml:"-" ini:"-"` OutputFile string `toml:"-" ini:"-"` URL string `toml:"-" ini:"-"` CreateTime time.Time `toml:"-" ini:"-"` UpdateTime time.Time `toml:"-" ini:"-"` RawBytes []byte `toml:"-" ini:"-"` ContentBytes []byte `toml:"-" ini:"-"` }
Page is a page
func (*Page) ContentHTML ¶
ContentHTML return page content as HTML type
type Pager ¶
type Pager struct { Begin int End int Prev int Next int Current int Pages int All int // contains filtered or unexported fields }
Pager contains pagination data when on a page number
type PagerCursor ¶
type PagerCursor struct {
// contains filtered or unexported fields
}
PagerCursor creates Pager with each page number
func NewPagerCursor ¶
func NewPagerCursor(size, all int) *PagerCursor
NewPagerCursor with size and all count
func (*PagerCursor) Page ¶
func (pg *PagerCursor) Page(i int) *Pager
Page creates Pager on a page number
type Post ¶
type Post struct { Title string `toml:"title" ini:"title"` Slug string `toml:"slug" ini:"slug"` Desc string `toml:"desc" ini:"desc"` CreateString string `toml:"date" ini:"date"` UpdateString string `toml:"update_date" ini:"update_date"` AuthorName string `toml:"author" ini:"author"` Thumb string `toml:"thumb" ini:"thumb"` Draft bool `toml:"draft" ini:"draft"` TagStrings []string `toml:"tags" ini:"-"` MetaFormat string `toml:"-" ini:"-"` SourceFile string `toml:"-" ini:"-"` SourceRelpath string `toml:"-" ini:"-"` OutputFile string `toml:"-" ini:"-"` URL string `toml:"-" ini:"-"` Tags []*PostTag `toml:"-" ini:"-"` Author *Author `toml:"-" ini:"-"` Index []*ContentIndex `toml:"-" ini:"-"` CreateTime time.Time `toml:"-" ini:"-"` UpdateTime time.Time `toml:"-" ini:"-"` RawBytes []byte `toml:"-" ini:"-"` ContentBytes []byte `toml:"-" ini:"-"` BriefBytes []byte `toml:"-" ini:"-"` }
Post is a post
func (*Post) ContentHTML ¶
ContentHTML return content as HTML
type Source ¶
type Source struct { PostDir string PageDir string PostFiles []SourceItem PageFiles []SourceItem CopyFiles []SourceItem RenderedFiles []string Posts []*Post Lists []PostList ListSize int TagsLists map[string]*TagList Archives []*Archive Pages []*Page I18ns map[string]*i18n.File }
Source is all source data object
type SourceItem ¶
SourceItem is an item reading from source directry
Click to show internal directories.
Click to hide internal directories.