Config File

_cobalt.yml let's you specify site-wide options as well as defaults for pages.

Default _cobalt.yml:

# Build options
source: "."
template_extensions:
  - md
  - liquid
include_drafts: false
ignore:
destination: _site

# Site options
site:
  title: ~
  description: ~
  base_url: ~
  sitemap: ~
  data: ~

# Page/Post options
default:
  excerpt_separator: "\n\n"
  is_draft: false
syntax_highlight:
  theme: "base16-ocean.dark"
  enabled: true
assets:
  sass:
    style: Nested
pages:
  default: {}
posts:
  title: ~
  description: ~
  dir: posts
  drafts_dir: _drafts
  order: Desc
  rss: ~
  jsonfeed: ~
  publish_date_in_filename: true
  default: {}

Build options

SettingFormatDescription
sourceStringDirectory, relative to _cobalt.yml, where content lives.
template_extensionsList of StringsFile extensions that mark a file as a page as compared to an asset.
include_draftsBooleanSpecifies whether posts marked is_draft should be generated by default. This can be overridden with command line flags.
ignoreList of StringsSpecifies what files should be ignored by Cobalt by way gitignore patterns, relative to source.
destinationStringDirectory, relative to _cobalt.yml, where the output is written to.

For example to unignore the .well-known/ folder used in LetsEncrypt, add this to your _cobalt.yml.

ignore:
  - "!.well-known"
  - "!.well-known/**/*"

Site options

These are all under site: in the yaml:

SettingFormatDescription
titleStringThe title for the site
descriptionStringA description for the site
base_urlStringThe root for the site. This is used in making paths absolute for RSS as well as in Liquid ({{ site.base_url }}/docs).
sitemapStringRelative path for where to generate a sitemap XML file.
dataObjectValues made available via the {{ site.data }} variable.

In addition to changing the defaults through CLI arguments/flags, Cobalt allows to specify a config file (default: _cobalt.yml) where you can store such settings.

Pages and Posts

Global options:

SettingFormatDescription
defaultFrontmatterSite-wide defaults for page frontmatters.
syntax_highlightSite-wide syntax highlighting settings
- themeStringSite-wide syntax highlighting theme. Run cobalt debug highlight themes for list of available themes
- enabledBooleanEnables or disables site-wide syntax highlighting

These are under pages: in the yaml:

SettingFormatDescription
defaultFrontmatterDefaults for page frontmatters.

These are under posts: in the yaml:

SettingFormatDescription
titleStringTitle for the posts collection. Falls back to site.title if not present.
descriptionStringDescription for the posts collection. Falls back to site.description if not present.
dirStringDirectory, relative to source, where posts lives.
drafts_dirStringDirectory, relative to source, where draft posts can live.
orderAsc, DescSort order for {{posts}} variable.
rssStringPath for a posts RSS file.
jsonfeedStringPath for a posts jsonfeed file.
defaultFrontmatterDefaults for post frontmatters.
publish_date_in_filenameBooleanPrepend YYYY-MM-DD- to filename on publish

These are under assets: in the yaml:

SettingFormatDescription
sassSass' CSS generation settings
- styleNested, Expanded, Compact, CompressedSite-wide format style for Sass-generated CSS.