Documentation ¶
Index ¶
Constants ¶
const Asciidoc = "ASCIIDOC"
Asciidoc is a const for identifying Asciidoc Documents
const Markdown = "MARKDOWN"
Markdown is a const for identifying Markdown Documents
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandLineSettings ¶ added in v0.0.11
type CommandLineSettings struct { // ConfigFilePath is the path to the Monako config ConfigFilePath string // MenuConfigFilePath is the path to the Menu config MenuConfigFilePath string // ContentWorkingDir is the directory where files should be created. Home of the compose folder. ContentWorkingDir string // BaseURL is the BaseURL of the site BaseURL string // Trace activates function name based logging Trace bool // FailOnHugoError will fail Monako when there are Hugo errors during build FailOnHugoError bool // OnlyCompose will only compose files but not generate HTML OnlyCompose bool // OnlyGenerate will only generate HTML files but not compose them OnlyGenerate bool }
CommandLineSettings contains all the flags and settings made via the command line in main
type Config ¶
type Config struct { BaseURL string `yaml:"baseURL"` Title string `yaml:"title"` Origins []Origin `yaml:"origins"` Logo string `yaml:"logo"` FileWhitelist []string `yaml:"whitelist"` DisableCommitInfo bool `yaml:"disableCommitInfo"` // HugoWorkingDir is the working dir for the Composition. For example "your/dir/compose" HugoWorkingDir string // ContentWorkingDir is the main working dir and where all the content is stored in. For example "your/dir/" ContentWorkingDir string }
Config is the root of the Monako config
func Init ¶ added in v0.0.11
func Init(cliSettings CommandLineSettings) (config *Config)
Init loads the Monako config, adds Workarounds, runs Hugo for initializing the workign dir
func LoadConfig ¶
LoadConfig returns the Monako config from the given configfilepath
type Origin ¶
type Origin struct { URL string `yaml:"src"` Branch string `yaml:"branch,omitempty"` EnvUsername string `yaml:"envusername,omitempty"` EnvPassword string `yaml:"envpassword,omitempty"` SourceDir string `yaml:"docdir,omitempty"` TargetDir string `yaml:"targetdir,omitempty"` FileWhitelist []string `yaml:"whitelist,omitempty"` Files []OriginFile // contains filtered or unexported fields }
Origin contains all information for a document origin
func (*Origin) CloneDir ¶
func (origin *Origin) CloneDir()
CloneDir clones a HTTPS or lokal Git repository with the given branch and optional username and password. A virtual filesystem is returned containing the cloned files.
func (*Origin) ComposeDir ¶
func (origin *Origin) ComposeDir()
ComposeDir copies a subdir of a virtual filesystem to a target in the local relative filesystem. The copied files can be limited by a whitelist. The Git repository is used to obtain Git commit information
type OriginFile ¶
type OriginFile struct { // Commit is the commit info about this file Commit *object.Commit // RemotePath is the path in the origin repository RemotePath string // LocalPath is the absolute path on the local disk LocalPath string // contains filtered or unexported fields }
OriginFile represents a single file of an origin
func (*OriginFile) ExpandFrontmatter ¶ added in v0.0.11
func (file *OriginFile) ExpandFrontmatter(content string) string
ExpandFrontmatter expands the existing frontmatter with the parameters given
func (OriginFile) GetFormat ¶
func (file OriginFile) GetFormat() string
GetFormat determines the markup format of a file by it's filename. Results can be Markdown and Asciidoc