assets

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyAssets

func CopyAssets(assetsDir, outputDir string) error

CopyAssets copies all files from assetsDir to outputDir, preserving directory structure. No transformation is applied — files are copied verbatim. Returns nil without error if assetsDir does not exist.

func ProcessAssets

func ProcessAssets(assetsDir, outputDir string, hookFn func(AssetFile) (AssetFile, error)) error

ProcessAssets copies files from assetsDir to outputDir, calling hookFn for each file before writing. The hook may modify the AssetFile content. If hookFn is nil, files are copied unchanged (same as CopyAssets).

func ResolveURL

func ResolveURL(path, baseURL string) string

ResolveURL resolves an asset path relative to baseURL.

Types

type AssetFile

type AssetFile struct {
	Path    string // Relative path within the assets directory (e.g., "css/main.css")
	Content []byte // Raw file content
}

AssetFile represents a single asset file passed through the onAssetProcess hook. Plugins receive this struct and may modify Content before it is written.

Jump to

Keyboard shortcuts

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