builder

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewParser

func NewParser() goldmark.Markdown

func ParseFiles

func ParseFiles(filename string) (*template.Template, error)

调用http.ParseFiles方法,附加通用模板

func WalkPosts

func WalkPosts(f func(dirName string, file fs.DirEntry))

并发在posts目录下处理事务

Types

type Builder

type Builder struct {
	Parser goldmark.Markdown
	model.Repo
	Counter
	Mux *http.ServeMux
}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Dump

func (builder *Builder) Dump()

func (*Builder) DumpAllContentOnlyPages

func (builder *Builder) DumpAllContentOnlyPages()

func (*Builder) DumpContentOnlyPage

func (builder *Builder) DumpContentOnlyPage(name string)

func (*Builder) DumpPosts

func (builder *Builder) DumpPosts()

读取content/posts下目录和文章,存取到builder.repo

func (*Builder) Freeze

func (builder *Builder) Freeze(tmpl string)

页面静态化

func (*Builder) FreezeAllContentOnlyPages

func (builder *Builder) FreezeAllContentOnlyPages()

静态化所有常规页面

func (*Builder) FreezeAssets

func (builder *Builder) FreezeAssets()

静态化assets目录

func (*Builder) FreezeCategory

func (builder *Builder) FreezeCategory()

静态化分类界面

func (*Builder) FreezeContentOnlyPage

func (builder *Builder) FreezeContentOnlyPage(name string)

静态化常规页面

func (*Builder) FreezeContents

func (builder *Builder) FreezeContents()

静态化目录页面

func (*Builder) FreezeEachCategoryPosts

func (builder *Builder) FreezeEachCategoryPosts()

静态化每个分类下文章页面

func (*Builder) FreezeIndex

func (builder *Builder) FreezeIndex()

静态化主页

func (*Builder) FreezePosts

func (builder *Builder) FreezePosts(tmpl string)

静态化文章页面

func (*Builder) FreezeStatic

func (builder *Builder) FreezeStatic()

静态化static目录

func (*Builder) ParseMarkdown

func (builder *Builder) ParseMarkdown(path string) (bytes.Buffer, map[string]any, error)

func (*Builder) Render

func (builder *Builder) Render()

func (*Builder) RenderAllContentOnlyPages

func (builder *Builder) RenderAllContentOnlyPages()

func (*Builder) RenderAssets

func (builder *Builder) RenderAssets()

func (*Builder) RenderCategory

func (builder *Builder) RenderCategory()

func (*Builder) RenderContentOnlyPage

func (builder *Builder) RenderContentOnlyPage(name string)

func (*Builder) RenderContents

func (builder *Builder) RenderContents()

func (*Builder) RenderEachCategoryPosts

func (builder *Builder) RenderEachCategoryPosts()

func (*Builder) RenderIndex

func (builder *Builder) RenderIndex()

func (*Builder) RenderPosts

func (builder *Builder) RenderPosts()

func (*Builder) Run

func (builder *Builder) Run(addr string, c rebirth.Context)

type Counter

type Counter struct {
	PostsNum int
	PagesNum int
}

func NewCounter

func NewCounter() *Counter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL