1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-12-11 17:00:02 +01:00
gojekyll/config/default.go

64 lines
1.6 KiB
Go
Raw Normal View History

2017-07-03 17:48:06 +02:00
package 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 Default() Config {
return FromString(defaultSiteConfig)
}
// FromString returns a new configuration initialized from a string
func FromString(src string) Config {
2017-07-24 18:18:24 +02:00
var c = Config{RequireFrontMatter: true}
2017-07-03 17:48:06 +02:00
// TODO this doesn't set c.Variables. Should it? If so,
// config.Unmarshal needs to merge them instead of overwriting them (unless yaml.Unmarshal already does this)
err := Unmarshal([]byte(src), &c)
if err != nil {
panic(err)
}
return c
}
// From https://jekyllrb.com/docs/configuration/#default-configuration
// The following includes only those keys that are currently implemented.
const defaultSiteConfig = `
# Where things are
source: .
destination: ./_site
layouts_dir: _layouts
data_dir: _data
includes_dir: _includes
collections:
posts:
output: true
# Handling Reading
include: [".htaccess"]
exclude: ["Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"]
keep_files: [".git", ".svn"]
encoding: "utf-8"
markdown_ext: "markdown,mkdown,mkdn,mkd,md"
strict_front_matter: false
# Plugins
plugins: []
2017-07-07 01:31:36 +02:00
# Conversion
excerpt_separator: "\n\n"
2017-07-23 17:25:17 +02:00
incremental: false
2017-07-07 01:31:36 +02:00
2017-07-07 21:28:51 +02:00
# Serving
detach: false
port: 4000
host: 127.0.0.1
baseurl: "" # does not include hostname
2017-07-03 17:48:06 +02:00
# Outputting
permalink: date
paginate_path: /page:num
timezone: null
2017-07-23 17:25:17 +02:00
verbose: false
2017-07-03 17:48:06 +02:00
`