plugins

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildContext

type BuildContext struct {
	Config     *config.Config
	RootDir    string
	OutDir     string
	PagesDir   string
	PublicDir  string
	Components map[string]*parser.Component
}

type HTMLTag

type HTMLTag struct {
	Tag        string
	Attributes map[string]string
	Content    string
	Position   TagPosition
}

type Manager

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

func NewDefaultManager

func NewDefaultManager(cfg *config.Config) *Manager

func NewManager

func NewManager(cfg *config.Config) *Manager

func (*Manager) BuildEnd

func (m *Manager) BuildEnd(ctx *BuildContext) error

func (*Manager) BuildStart

func (m *Manager) BuildStart(ctx *BuildContext) error

func (*Manager) InjectTags

func (m *Manager) InjectTags() []HTMLTag

func (*Manager) Load

func (m *Manager) Load(rootDir, outDir string) error

func (*Manager) Plugins

func (m *Manager) Plugins() []Plugin

func (*Manager) Register

func (m *Manager) Register(plugin Plugin)

func (*Manager) TransformCSS

func (m *Manager) TransformCSS(css string, filePath string) (string, error)

func (*Manager) TransformJS

func (m *Manager) TransformJS(js string, filePath string) (string, error)

type Plugin

type Plugin interface {
	Name() string
	Setup(ctx *SetupContext) error
	TransformCSS(css string, filePath string) (string, error)
	TransformJS(js string, filePath string) (string, error)
	InjectTags() []HTMLTag
	BuildStart(ctx *BuildContext) error
	BuildEnd(ctx *BuildContext) error
}

type SetupContext

type SetupContext struct {
	Config    *config.Config
	PluginCfg map[string]interface{}
	RootDir   string
	OutDir    string
}

type TagPosition

type TagPosition int
const (
	HeadStart TagPosition = iota
	HeadEnd
	BodyStart
	BodyEnd
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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