Documentation
¶
Index ¶
- Constants
- Variables
- func ExportJSX(name string, src []byte, globals map[string]any) (map[string]any, error)
- func RenderJSX(name string, src []byte, globals map[string]any, args ...any) ([]byte, error)
- func RenderTemplate(name string, src []byte, funcs template.FuncMap) ([]byte, error)
- type Data
- type JSXParser
- type MarkdownParser
- type Page
- func (p *Page) Body() []byte
- func (p *Page) ContentType() string
- func (p *Page) Date() string
- func (p *Page) Draft() bool
- func (p *Page) IsDir() bool
- func (p *Page) Parse() error
- func (p *Page) Preamble() string
- func (p *Page) Render(w io.Writer) (err error)
- func (p *Page) Slug() string
- func (p *Page) Source() []byte
- func (p *Page) Subpages() (subpages []*Page)
- func (p *Page) Time() time.Time
- type PageParser
- type Site
- func (s *Site) GenerateAll(dest string, clobber bool) (err error)
- func (s *Site) IsPage(path string) bool
- func (s *Site) Page(normalPath string) *Page
- func (s *Site) Pages(name string) (pages []*Page)
- func (s *Site) ParseAll() error
- func (s *Site) Partial(name string, globals map[string]any, args ...any) ([]byte, error)
- func (s *Site) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Site) WatchForReloads()
- type TemplateParser
Constants ¶
View Source
const ( ExtMarkdown = ".md" ExtTemplate = ".tmpl" ExtJSX = ".jsx" )
View Source
const ( Layout = "layout" Slug = "slug" Path = "path" Source = "src" Body = "body" IsDir = "isDir" Date = "date" ContentType = "contentType" Draft = "draft" Preamble = "preamble" )
Variables ¶
View Source
var Formats = map[string]PageParser{ ExtMarkdown: &MarkdownParser{}, ExtTemplate: &TemplateParser{}, ExtJSX: &JSXParser{}, }
Functions ¶
Types ¶
type MarkdownParser ¶
type MarkdownParser struct{}
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
func (*Page) ContentType ¶
type Site ¶
type Site struct {
// contains filtered or unexported fields
}
func (*Site) WatchForReloads ¶
func (s *Site) WatchForReloads()
type TemplateParser ¶
type TemplateParser struct{}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.