Documentation ¶
Index ¶
- type Builder
- func (b *Builder) BuildAll() error
- func (b *Builder) BuildExtraPages() error
- func (b *Builder) BuildOne(tplPath, outPath string) error
- func (b *Builder) BuildPostLists() error
- func (b *Builder) BuildPostPreview(outPath string) error
- func (b *Builder) BuildPosts() error
- func (b *Builder) CheckDirectories() error
- func (b *Builder) RemovePublic() error
- func (b *Builder) Render(tplName string, funcMap map[string]any, bs []byte, content *RenderContext) (string, error)
- func (b *Builder) RenderFile(tplPath string, funcMap map[string]any, content *RenderContext) (string, error)
- func (b *Builder) RenderSource(tplPath string, content *RenderContext) (string, error)
- func (b *Builder) RenderTheme(tplPath string, content *RenderContext) (string, error)
- func (b *Builder) SyncUploads() error
- type Page
- type Post
- type RenderContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func New ¶
func New(conf *config.SiteConfig, files fsys.FileSystem) (*Builder, error)
func (*Builder) BuildExtraPages ¶
func (*Builder) BuildPostLists ¶
BuildPostLists builds paginated lists of posts.
func (*Builder) BuildPostPreview ¶
func (*Builder) BuildPosts ¶
BuildPosts builds all the posts in the source directory.
func (*Builder) CheckDirectories ¶
func (*Builder) RemovePublic ¶
RemovePublic removes cached files from the public directory.
func (*Builder) Render ¶
func (b *Builder) Render(tplName string, funcMap map[string]any, bs []byte, content *RenderContext) (string, error)
Render renders a template with the given content.
func (*Builder) RenderFile ¶
func (b *Builder) RenderFile(tplPath string, funcMap map[string]any, content *RenderContext) (string, error)
RenderFile renders a template from a file with the given content.
func (*Builder) RenderSource ¶
func (b *Builder) RenderSource(tplPath string, content *RenderContext) (string, error)
RenderSource renders a source template with the given content.
func (*Builder) RenderTheme ¶
func (b *Builder) RenderTheme(tplPath string, content *RenderContext) (string, error)
RenderTheme renders a template with the given content.
func (*Builder) SyncUploads ¶
SyncUploads copies the uploads directory from the source to the public directory.
type Post ¶
type Post struct { Title string Body string Blurb string Href string Tags []string SkipIndex bool `yaml:"skip_index"` SkipPublish bool `yaml:"skip_publish"` CreatedAt time.Time `yaml:"created_at"` UpdatedAt time.Time `yaml:"updated_at"` // contains filtered or unexported fields }
func (*Post) UpdateFromConfig ¶
func (p *Post) UpdateFromConfig(pc *config.PostConfig)
UpdateFromConfig updates post properties fron a config.PostConfig object.
type RenderContext ¶
type RenderContext struct { Site *config.SiteConfig Post *Post Posts []*Post Page *Page Args map[string]any TagMap map[string]int }
func (*RenderContext) AddTags ¶
func (r *RenderContext) AddTags(tags ...string)
AddTags add tags and their counts to the context.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.