Documentation
¶
Index ¶
- func Unmarshal(bytes []byte, c *Config) error
- type Config
- func (c *Config) ApplyFlags(f Flags)
- func (c *Config) FromDirectory(dir string) error
- func (c *Config) GetFrontMatterDefaults(typename, rel string) (m map[string]interface{})
- func (c *Config) IsConfigPath(rel string) bool
- func (c *Config) IsMarkdown(name string) bool
- func (c *Config) IsSASSPath(name string) bool
- func (c *Config) Map(key string) (map[string]interface{}, bool)
- func (c *Config) MarkdownExtensions() []string
- func (c *Config) OutputExt(pathname string) string
- func (c *Config) RequiresFrontMatter(rel string) bool
- func (c *Config) SassDir() string
- func (c *Config) Set(key string, val interface{})
- func (c *Config) SourceDir() string
- func (c *Config) String(key string) (string, bool)
- func (c *Config) Variables() map[string]interface{}
- type Flags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Where things are:
Source string
Destination string
LayoutsDir string `yaml:"layouts_dir"`
DataDir string `yaml:"data_dir"`
IncludesDir string `yaml:"includes_dir"`
Collections map[string]map[string]interface{} `yaml:"-"`
Theme string
// Handling Reading
Include []string
Exclude []string
KeepFiles []string `yaml:"keep_files"`
MarkdownExt string `yaml:"markdown_ext"`
// Filtering Content
Drafts bool `yaml:"show_drafts"`
Future bool
Unpublished bool
// Plugins
Plugins []string
// Conversion
ExcerptSeparator string `yaml:"excerpt_separator"`
Incremental bool
Sass struct {
Dir string `yaml:"sass_dir"`
}
// Serving
Host string
Port int
AbsoluteURL string `yaml:"url"`
BaseURL string
// Outputting
Permalink string
Timezone string
Verbose bool
Defaults []struct {
Scope struct {
Path string
Type string
}
Values map[string]interface{}
}
// CLI-only
DryRun bool `yaml:"-"`
ForcePolling bool `yaml:"-"`
Watch bool `yaml:"-"`
// Meta
ConfigFile string `yaml:"-"`
// Plugins
RequireFrontMatter bool `yaml:"-"`
RequireFrontMatterExclude map[string]bool `yaml:"-"`
// contains filtered or unexported fields
}
Config is the Jekyll site configuration, typically read from _config.yml. See https://jekyllrb.com/docs/configuration/#default-configuration
func Default ¶
func Default() Config
Default returns a default site configuration.
This is a function instead of a global variable, and returns a new value each time, since the caller may overwrite it.
func FromString ¶
FromString returns a new configuration initialized from a string
func (*Config) ApplyFlags ¶
ApplyFlags overwrites the configuration with values from flags.
func (*Config) FromDirectory ¶ added in v0.2.0
FromDirectory updates the config from the config file in the directory, if such a file exists.
func (*Config) GetFrontMatterDefaults ¶
GetFrontMatterDefaults implements https://jekyllrb.com/docs/configuration/#front-matter-defaults
func (*Config) IsConfigPath ¶ added in v0.2.0
IsConfigPath returns true if its arguments is a site configuration file.
func (*Config) IsMarkdown ¶
IsMarkdown returns a boolean indicating whether the file is a Markdown file, according to the current project.
func (*Config) IsSASSPath ¶
IsSASSPath returns a boolean indicating whether the file is a Sass (".sass" or ".scss") file.
func (*Config) MarkdownExtensions ¶
MarkdownExtensions returns a list of markdown extensions, with dotsa.
func (*Config) OutputExt ¶
OutputExt returns the pathname's output extension. This is generally the pathname extension; exceptions are *.md -> *.html, and *.{sass,scss} -> *.css.
func (*Config) RequiresFrontMatter ¶ added in v0.2.0
RequiresFrontMatter returns a bool indicating whether the file requires front matter in order to recognize as a page.
func (*Config) Set ¶ added in v0.2.6
Set sets a value in the Liquid variable map. This does not update the corresponding value in the Config struct.
type Flags ¶
type Flags struct {
// these are pointers so we can tell whether they've been set, and leave
// the config file alone if not
Destination, Host *string
Drafts, Future, Unpublished *bool
Incremental, Verbose *bool
Port *int
// these aren't in the config file, so make them actual values
DryRun, ForcePolling, Watch bool
}
Flags are applied after the configuration file is loaded. They are pointers to represent optional types, to tell whether they have been set.