assets

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx *core.Context) (hook.Hook, error)

Types

type Asset

type Asset struct {
	Files        []string
	Filters      []Filter
	SassCompiler SassCompiler
	Output       string
	ShowVersion  bool
}

func (*Asset) Execute

func (n *Asset) Execute(ctx context.Context, assetsFS fs.FS, writer core.Writer) error

type AssetsHook

type AssetsHook struct {
	hook.HookImpl
	// contains filtered or unexported fields
}

func (*AssetsHook) AfterBuild

func (h *AssetsHook) AfterBuild(ctx context.Context, w core.Writer) error

写入收集的文件

func (*AssetsHook) BeforeBuild

func (h *AssetsHook) BeforeBuild() error

func (*AssetsHook) HandleTemplateSet

func (h *AssetsHook) HandleTemplateSet(set template.TemplateSet) (template.TemplateSet, error)

type DartSassCompiler added in v0.1.8

type DartSassCompiler struct{}

func (*DartSassCompiler) Compile added in v0.1.8

func (c *DartSassCompiler) Compile(assetsFS fs.FS, file string, buf []byte) ([]byte, error)

func (*DartSassCompiler) Name added in v0.1.8

func (c *DartSassCompiler) Name() string

type Filter added in v0.1.8

type Filter interface {
	Name() string
	Execute([]byte) ([]byte, error)
}

type ImageFilter added in v0.1.8

type ImageFilter struct {
	Width   int
	Height  int
	Fit     string
	Quality int
	Format  string
}

func (ImageFilter) Apply added in v0.1.8

func (f ImageFilter) Apply(img image.Image) image.Image

func (ImageFilter) Encode added in v0.1.8

func (f ImageFilter) Encode(w io.Writer, img image.Image, format string) error

func (*ImageFilter) Execute added in v0.1.8

func (f *ImageFilter) Execute(buf []byte) ([]byte, error)

func (*ImageFilter) Name added in v0.1.8

func (f *ImageFilter) Name() string

type LibSassCompiler added in v0.1.8

type LibSassCompiler struct{}

func (*LibSassCompiler) Compile added in v0.1.8

func (c *LibSassCompiler) Compile(assetsFS fs.FS, file string, buf []byte) ([]byte, error)

func (*LibSassCompiler) Name added in v0.1.8

func (c *LibSassCompiler) Name() string

type MinifyFilter added in v0.1.8

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

func (*MinifyFilter) Execute added in v0.1.8

func (f *MinifyFilter) Execute(buf []byte) (result []byte, err error)

func (*MinifyFilter) Name added in v0.1.8

func (f *MinifyFilter) Name() string

type SassCompiler added in v0.1.8

type SassCompiler interface {
	Name() string
	Compile(fs.FS, string, []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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