sgunk

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig

type BuildConfig struct {
	Dir string `yaml:"dir"`
}

func (*BuildConfig) GetDir

func (c *BuildConfig) GetDir() string

type DirConfig

type DirConfig interface {
	GetDir() string
}

type Extension

type Extension interface {
	Name() string
	Register(p *Project, c map[string]any) error
}

type ExtensionConfig

type ExtensionConfig struct {
	Name   string
	Config map[string]any
}

func (*ExtensionConfig) UnmarshalYAML

func (ex *ExtensionConfig) UnmarshalYAML(value *yaml.Node) error

type MiddlewareConfig

type MiddlewareConfig struct {
	Path      string `yaml:"path"`
	Extension string `yaml:"extension"`
}

type Project

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

func New

func New(opts ...ProjectOption) *Project

func (*Project) Generate

func (p *Project) Generate() error

type ProjectConfig

type ProjectConfig struct {
	Name  string            `yaml:"name"`
	Site  SiteConfig        `yaml:"site"`
	Theme ThemeConfig       `yaml:"theme"`
	Build BuildConfig       `yaml:"build"`
	Uses  []ExtensionConfig `yaml:"uses"`
}

func LoadConfigFile

func LoadConfigFile(projectFS afero.Fs) (*ProjectConfig, error)

type ProjectOption

type ProjectOption interface {
	Apply(*Project) error
}

type ProjectOptionFunc

type ProjectOptionFunc func(*Project) error

func WithConfig

func WithConfig(config *ProjectConfig) ProjectOptionFunc

func WithExtensions

func WithExtensions(extensions ...Extension) ProjectOptionFunc

func WithParserOptions

func WithParserOptions(opts ...parser.ParserOption) ProjectOptionFunc

func WithRendererOptions

func WithRendererOptions(opts ...renderer.RendererOption) ProjectOptionFunc

func WithWorkDir

func WithWorkDir(dir string) ProjectOptionFunc

func (ProjectOptionFunc) Apply

func (apply ProjectOptionFunc) Apply(p *Project) error

type SiteConfig

type SiteConfig struct {
	Dir string `yaml:"dir"`
}

func (*SiteConfig) GetDir

func (c *SiteConfig) GetDir() string

type ThemeConfig

type ThemeConfig struct {
	Dir string `yaml:"dir"`
}

func (*ThemeConfig) GetDir

func (c *ThemeConfig) GetDir() string

Directories

Path Synopsis
cmd
extension

Jump to

Keyboard shortcuts

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