Documentation ¶
Index ¶
- Constants
- func CreateTargetFile(output string) (*os.File, error)
- func Exists(path string) (bool, error)
- func GenerateDir(outputFile string) error
- type Article
- type ArticlePlugin
- type Assis
- type AssisTemplate
- type Config
- type File
- type FileContainer
- type Generator
- type HTMLPlugin
- type Linux
- type MaCOSX
- type MinifyPlugin
- type OS
- type PluginCustomFunction
- type PluginGeneratedFiles
- type PluginLoadFiles
- type PluginRender
- type Server
- type SiteFiles
- type SiteGenerator
- type StaticFilesPlugin
- type StaticServe
- type Tags
- type Template
- type Templates
- type Windows
Constants ¶
View Source
const HTML = ".html"
View Source
const MD = ".md"
Variables ¶
This section is empty.
Functions ¶
func GenerateDir ¶
Types ¶
type ArticlePlugin ¶
type ArticlePlugin struct {
// contains filtered or unexported fields
}
func NewArticlePlugin ¶
func NewArticlePlugin(config *Config, logger *zap.Logger) ArticlePlugin
func (ArticlePlugin) OnRegisterCustomFunction ¶
func (m ArticlePlugin) OnRegisterCustomFunction() map[string]interface{}
func (ArticlePlugin) OnRender ¶
func (m ArticlePlugin) OnRender(t AssisTemplate, siteFiles SiteFiles, templates Templates) error
type Assis ¶
type Assis struct {
// contains filtered or unexported fields
}
func (*Assis) LoadContent ¶
func (*Assis) LoadFilesAsync ¶
type AssisTemplate ¶
type AssisTemplate struct {
// contains filtered or unexported fields
}
func NewAssisTemplate ¶
func NewAssisTemplate(funcMap template.FuncMap) AssisTemplate
func (AssisTemplate) GetTemplate ¶
func (a AssisTemplate) GetTemplate() *template.Template
type Config ¶
type Config struct { SiteRoot string `json:"site_root"` Output string `json:"output"` Content string `json:"content"` Template Template `json:"template"` Server Server `json:"server"` }
func NewConfigFromFile ¶
func SetDefaultConfigs ¶
type FileContainer ¶
type FileContainer struct {
// contains filtered or unexported fields
}
func (*FileContainer) AddOnEntry ¶
func (f *FileContainer) AddOnEntry(file string)
func (*FileContainer) FilterExt ¶
func (f *FileContainer) FilterExt(ext []string) []File
func (*FileContainer) FullFilename ¶
func (f *FileContainer) FullFilename(file File) string
func (*FileContainer) GetFile ¶
func (f *FileContainer) GetFile(filename string) string
func (*FileContainer) OutputFilename ¶
func (f *FileContainer) OutputFilename(file File) string
type Generator ¶
func NewGenerator ¶
type HTMLPlugin ¶
type HTMLPlugin struct {
// contains filtered or unexported fields
}
func NewHTMLPlugin ¶
func NewHTMLPlugin(config *Config, logger *zap.Logger) HTMLPlugin
func (HTMLPlugin) OnRegisterCustomFunction ¶
func (h HTMLPlugin) OnRegisterCustomFunction() map[string]interface{}
func (HTMLPlugin) OnRender ¶
func (h HTMLPlugin) OnRender(t AssisTemplate, siteFiles SiteFiles, templates Templates) error
type MinifyPlugin ¶
type MinifyPlugin struct {
// contains filtered or unexported fields
}
func NewMinifyPlugin ¶
func NewMinifyPlugin(logger *zap.Logger) MinifyPlugin
func (MinifyPlugin) AfterGeneratedFiles ¶
func (m MinifyPlugin) AfterGeneratedFiles(files []string) error
func (MinifyPlugin) AllowedMediaType ¶
func (m MinifyPlugin) AllowedMediaType(filename string) string
type OS ¶
func GetOSBySystem ¶
func GetOSBySystem() OS
type PluginCustomFunction ¶
type PluginCustomFunction interface {
OnRegisterCustomFunction() map[string]interface{}
}
type PluginGeneratedFiles ¶
type PluginLoadFiles ¶
type PluginRender ¶
type PluginRender interface {
OnRender(AssisTemplate, SiteFiles, Templates) error
}
type SiteFiles ¶
type SiteFiles map[string]*FileContainer
func (SiteFiles) Add ¶
func (s SiteFiles) Add(fc *FileContainer, entry string)
func (SiteFiles) Get ¶
func (s SiteFiles) Get(entry string) *FileContainer
type SiteGenerator ¶
type SiteGenerator struct {
// contains filtered or unexported fields
}
func (SiteGenerator) Render ¶
func (h SiteGenerator) Render(siteFiles SiteFiles) error
type StaticFilesPlugin ¶
type StaticFilesPlugin struct {
// contains filtered or unexported fields
}
func NewStaticFilesPlugin ¶
func NewStaticFilesPlugin(config *Config, allowedExt []string, logger *zap.Logger) StaticFilesPlugin
func (StaticFilesPlugin) AfterLoadFiles ¶
func (s StaticFilesPlugin) AfterLoadFiles(files SiteFiles) error
type StaticServe ¶
type StaticServe struct {
// contains filtered or unexported fields
}
func NewStaticServer ¶
func NewStaticServer(config *Config, logger *zap.Logger, listen func() error) StaticServe
func (StaticServe) ListenAndServe ¶
func (s StaticServe) ListenAndServe() error
func (StaticServe) Watch ¶
func (s StaticServe) Watch(os OS) error
type Templates ¶
type Templates struct {
// contains filtered or unexported fields
}
func NewTemplates ¶
func (*Templates) GetTemplatesByDir ¶
Click to show internal directories.
Click to hide internal directories.