mark2web/pkg/mark2web/config_path.go
Sebastian Frank ff1da084af
All checks were successful
continuous-integration/drone/push Build is passing
collections via markdown files
2019-03-22 17:22:03 +01:00

99 lines
3.0 KiB
Go

package mark2web
import "gitbase.de/apairon/mark2web/pkg/helper"
// CollectionDirectoryConfig specifies how to handle a directory of markdown files as a collection
type CollectionDirectoryConfig struct {
Path string `yaml:"Path"`
MatchFilename string `yaml:"MatchFilename"`
ReverseOrder bool `yaml:"ReverseOrder"`
}
// CollectionConfig describes a collection
type CollectionConfig struct {
Name *string `yaml:"Name"`
URL *string `yaml:"URL"`
Directory *CollectionDirectoryConfig `yaml:"Directory"`
NavTemplate *struct {
EntriesAttribute string `yaml:"EntriesAttribute"`
GoTo string `yaml:"GoTo"`
Navname string `yaml:"Navname"`
Body string `yaml:"Body"`
DataKey string `yaml:"DataKey"`
Hidden bool `yaml:"Hidden"`
Template string `yaml:"Template"`
//Recursive bool `yaml:"Recursive"`
} `yaml:"NavTemplate"`
}
// ThisPathConfig is struct for This in paths yaml
type ThisPathConfig struct {
Navname *string `yaml:"Navname"`
GoTo *string `yaml:"GoTo"`
Collections []*CollectionConfig `yaml:"Collections"`
Data helper.MapString `yaml:"Data"`
}
// IndexConfig describes index input and output file
type IndexConfig struct {
InputFile *string `yaml:"InputFile"`
InputString *string `yaml:"InputString"`
OutputFile *string `yaml:"OutputFile"`
}
// MetaData describes meta data for current site/tree node
type MetaData struct {
Title *string `yaml:"Title"`
Description *string `yaml:"Description"`
Keywords *string `yaml:"Keywords"`
}
// DirnameConfig describes how to handle directory names
type DirnameConfig struct {
Strip *string `yaml:"Strip"`
IgnoreForNav *string `yaml:"IgnoreForNav"`
}
// FilenameConfig describes how to handle filenames
type FilenameConfig struct {
Strip *string `yaml:"Strip"`
Ignore *string `yaml:"Ignore"`
OutputExtension *string `yaml:"OutputExtension"`
}
// MarkdownConfig describes markdown handling
type MarkdownConfig struct {
ChromaRenderer *bool `yaml:"ChromaRenderer"`
ChromaStyle *string `yaml:"ChromaStyle"`
}
// ImagingConfig defines parameter for imaging processing
type ImagingConfig struct {
Width int `yaml:"Width"`
Height int `yaml:"Height"`
Process string `yaml:"Process"`
Anchor string `yaml:"Anchor"`
Quality int `yaml:"Quality"`
TargetDir string `yaml:"-"`
Filename string `yaml:"-"`
Format string `yaml:"-"`
}
// PathConfig of subdir
type PathConfig struct {
This ThisPathConfig `yaml:"This"`
Template *string `yaml:"Template"`
Index *IndexConfig `yaml:"Index"`
Meta *MetaData `yaml:"Meta"`
Path *DirnameConfig `yaml:"Path"`
Filename *FilenameConfig `yaml:"Filename"`
Markdown *MarkdownConfig `yaml:"Markdown"`
Imaging *ImagingConfig `yaml:"Imaging"`
Data helper.MapString `yaml:"Data"`
// Collections here are recursive if saved as nav, so request should be filtered
Collections []*CollectionConfig `yaml:"Collections"`
}