hook

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(ctx *core.Context)

func Register

func Register(name string, c Factory)

func Unmarshal

func Unmarshal(data any, value any) error

Types

type BuildHook

type BuildHook interface {
	AfterBuild(context.Context, core.Writer) error
	BeforeBuild() error
	HandleWriter(core.Writer) (core.Writer, error)
	HandleTemplateSet(template.TemplateSet) (template.TemplateSet, error)
}

type ContentHook

type ContentHook interface {
	HandlePage(*content.Page) *content.Page
	HandlePages(content.Pages) content.Pages

	HandleSection(*content.Section) *content.Section
	HandleSections(content.Sections) content.Sections

	HandleTaxonomy(*content.Taxonomy) *content.Taxonomy
	HandleTaxonomies(content.Taxonomies) content.Taxonomies
}

type Factory

type Factory func(*core.Context) (Hook, error)

type Hook

type Hook interface {
	BuildHook
	ContentHook
}

type HookImpl

type HookImpl struct{}

func (HookImpl) AfterBuild

func (HookImpl) AfterBuild(context.Context, core.Writer) error

func (HookImpl) BeforeBuild

func (HookImpl) BeforeBuild() error

func (HookImpl) HandlePage

func (HookImpl) HandlePage(result *content.Page) *content.Page

func (HookImpl) HandlePages

func (HookImpl) HandlePages(results content.Pages) content.Pages

func (HookImpl) HandleSection

func (HookImpl) HandleSection(result *content.Section) *content.Section

func (HookImpl) HandleSections

func (HookImpl) HandleSections(results content.Sections) content.Sections

func (HookImpl) HandleTaxonomies

func (HookImpl) HandleTaxonomies(results content.Taxonomies) content.Taxonomies

func (HookImpl) HandleTaxonomy

func (HookImpl) HandleTaxonomy(result *content.Taxonomy) *content.Taxonomy

func (HookImpl) HandleTemplateSet

func (HookImpl) HandleTemplateSet(set template.TemplateSet) (template.TemplateSet, error)

func (HookImpl) HandleWriter

func (HookImpl) HandleWriter(writer core.Writer) (core.Writer, error)

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func New

func New(ctx *core.Context) (*Registry, error)

func (*Registry) AfterBuild

func (r *Registry) AfterBuild(ctx context.Context, writer core.Writer) error

func (*Registry) BeforeBuild

func (r *Registry) BeforeBuild() error

func (*Registry) HandlePage

func (r *Registry) HandlePage(result *content.Page) *content.Page

func (*Registry) HandlePages

func (r *Registry) HandlePages(results content.Pages) content.Pages

func (*Registry) HandleSection

func (r *Registry) HandleSection(result *content.Section) *content.Section

func (*Registry) HandleSections

func (r *Registry) HandleSections(results content.Sections) content.Sections

func (*Registry) HandleTaxonomies

func (r *Registry) HandleTaxonomies(results content.Taxonomies) content.Taxonomies

func (*Registry) HandleTaxonomy

func (r *Registry) HandleTaxonomy(result *content.Taxonomy) *content.Taxonomy

func (*Registry) HandleTemplateSet

func (r *Registry) HandleTemplateSet(set template.TemplateSet) (template.TemplateSet, error)

func (*Registry) HandleWriter

func (r *Registry) HandleWriter(writer core.Writer) (core.Writer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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