Documentation
¶
Index ¶
- type Config
- type ConfigBuild
- type ConfigBuildSteps
- type ConfigGoldmark
- type ConfigGoldmarkParser
- type ConfigGoldmarkRenderer
- type ConfigShizuka
- type ConfigSite
- type ConfigStepContent
- type ConfigStepHeaders
- type ConfigStepRSS
- type ConfigStepRedirects
- type ConfigStepSitemap
- type ConfigStepStatic
- type Options
- func (o *Options) WithConfig(path string) *Options
- func (o *Options) WithContext(ctx context.Context) *Options
- func (o *Options) WithDestination(dest iofs.Writable) *Options
- func (o *Options) WithDestinationPath(path string) *Options
- func (o *Options) WithDev() *Options
- func (o *Options) WithErrTemplate(tmpl *template.Template) *Options
- func (o *Options) WithEventHandler(handler events.Handler) *Options
- func (o *Options) WithMaxWorkers(n int) *Options
- func (o *Options) WithOutput(path string) *Options
- func (o *Options) WithPageErrorTemplates(pages map[error]*template.Template) *Options
- func (o *Options) WithSiteURL(url string) *Options
- func (o *Options) WithSource(source iofs.Readable) *Options
- func (o *Options) WithSourcePath(path string) *Options
- type Redirect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Shizuka ConfigShizuka `toml:"shizuka" yaml:"shizuka" json:"shizuka"`
Site ConfigSite `toml:"site" yaml:"site" json:"site"`
Build ConfigBuild `toml:"build" yaml:"build" json:"build"`
}
Config represents the configuration for the build process.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig constructs a new Config with default values.
func (*Config) WatchedPaths ¶
type ConfigBuild ¶
type ConfigBuild struct {
Output string `toml:"output" yaml:"output" json:"output"`
Minify bool `toml:"minify" yaml:"minify" json:"minify"`
Steps ConfigBuildSteps `toml:"steps" yaml:"steps" json:"steps"`
}
type ConfigBuildSteps ¶
type ConfigBuildSteps struct {
Static *ConfigStepStatic `toml:"static" yaml:"static" json:"static"`
Content *ConfigStepContent `toml:"content" yaml:"content" json:"content"`
Headers *ConfigStepHeaders `toml:"headers" yaml:"headers" json:"headers"`
Redirects *ConfigStepRedirects `toml:"redirects" yaml:"redirects" json:"redirects"`
RSS *ConfigStepRSS `toml:"rss" yaml:"rss" json:"rss"`
Sitemap *ConfigStepSitemap `toml:"sitemap" yaml:"sitemap" json:"sitemap"`
}
type ConfigGoldmark ¶
type ConfigGoldmark struct {
Extensions []string `toml:"extensions" yaml:"extensions" json:"extensions"`
Parser ConfigGoldmarkParser `toml:"parser" yaml:"parser" json:"parser"`
Renderer ConfigGoldmarkRenderer `toml:"renderer" yaml:"renderer" json:"renderer"`
}
func (ConfigGoldmark) Build ¶
func (cfg ConfigGoldmark) Build() gm.Markdown
type ConfigGoldmarkParser ¶
type ConfigGoldmarkRenderer ¶
type ConfigShizuka ¶
type ConfigShizuka struct {
Version string `toml:"version" yaml:"version" json:"version"`
}
type ConfigSite ¶
type ConfigStepContent ¶
type ConfigStepContent struct {
TemplateGlob string `toml:"template_glob" yaml:"template_glob" json:"template_glob"`
Source string `toml:"source" yaml:"source" json:"source"`
Destination string `toml:"destination" yaml:"destination" json:"destination"`
DefaultParams map[string]any `toml:"default_params" yaml:"default_params" json:"default_params"`
Cascade map[string]any `toml:"cascade" yaml:"cascade" json:"cascade"`
GoldmarkConfig ConfigGoldmark `toml:"goldmark_config" yaml:"goldmark_config" json:"goldmark_config"`
}
type ConfigStepHeaders ¶
type ConfigStepRSS ¶
type ConfigStepRedirects ¶
type ConfigStepSitemap ¶
type ConfigStepStatic ¶
type Options ¶
type Options struct {
Context context.Context
ConfigPath string
OutputPath string
SiteURL string
MaxWorkers int
Dev bool
Source iofs.Readable
Destination iofs.Writable
PageErrTemplates map[error]*template.Template
ErrTemplate *template.Template
EventHandler events.Handler
}
Options represents the options for building a site.
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions constructs an Options with default values.
func (*Options) WithConfig ¶
WithConfig sets the path to the configuration file
func (*Options) WithContext ¶
WithContext sets the root context for building
func (*Options) WithDestination ¶
WithDestination sets the output destination for building.
func (*Options) WithDestinationPath ¶
WithDestinationPath sets the output destination using an OS path.
func (*Options) WithErrTemplate ¶
WithErrTemplate sets the error template for building
func (*Options) WithEventHandler ¶
WithEventHandler sets the event handler for building
func (*Options) WithMaxWorkers ¶
WithMaxWorkers sets the maximum number of workers to use for building
func (*Options) WithOutput ¶
WithOutput sets the path to the output directory, overriding config
func (*Options) WithPageErrorTemplates ¶
WithPageErrorTemplates sets the page error templates for building, nil corresponds to a catch-all template
func (*Options) WithSiteURL ¶
WithSiteURL sets the site base URL, overriding config.
func (*Options) WithSource ¶
WithSource sets the input source for building.
func (*Options) WithSourcePath ¶
WithSourcePath sets the input source using an OS path.