Documentation
¶
Overview ¶
Package clientplugins provides a declarative manifest-driven loader for client-side plugins. Instead of separate Go subpackages, all pure JS/CSS plugins are defined in manifest.yaml with inject_when rules, and their assets are embedded via go:embed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize() error
Initialize loads the embedded plugin manifest and pre-computes bundles. Safe to call multiple times; only the first call does work.
func PluginSlugs ¶
func PluginSlugs() []string
PluginSlugs returns the slugs of all plugins defined in the manifest.
func RecomputeFromDir ¶
RecomputeFromDir reloads and rebundles all plugin client assets from the given filesystem directory. For use by 'sarde dev --theme-dev' only.
Types ¶
type Manifest ¶
type Manifest struct {
Plugins map[string]ManifestEntry `yaml:"plugins"`
}
Manifest holds all client plugin definitions.
type ManifestEntry ¶
type ManifestEntry struct {
Description string `yaml:"description"`
InjectWhen string `yaml:"inject_when"`
Assets struct {
CSS string `yaml:"css"`
JS string `yaml:"js"`
} `yaml:"assets"`
Module bool `yaml:"module"`
}
ManifestEntry defines a single client-side plugin in the manifest.