package config import ( "os" "gopkg.in/yaml.v3" ) type Pipeline struct { // Pipeline is a list of operations, each one should have at least one key in "source", "use", "target". The remaining keys are options for that operation Pipeline []map[string]any `yaml:"pipeline"` } type BuildOptions struct { // Excludes lists files and folders to globally exclude from compilation Excludes []string `yaml:",omitempty"` } type Cabretfile struct { Options BuildOptions Build []Pipeline } func ReadCabretfile(file string) (*Cabretfile, error) { f, err := os.Open(file) if err != nil { return nil, err } site := new(Cabretfile) if err := yaml.NewDecoder(f).Decode(site); err != nil { return nil, err } return site, nil }