Configuration

ssg-config.json: every key, the reserved names, and the starter's feed and sitemap.

ssg-config.json

ssg-config.json in the site root is merged over the defaults, so every key is optional and the file itself may be absent.

json{
	"outputDir": "_site",
	"passthru": [],
	"ignore": [],
	"minify": false,
	"tidyHtml": false,
	"baseUrl": "",
	"permalinks": {},
	"taxonomies": []
}
KeyDefaultMeaning
outputDir"_site"Build output folder. It is deleted on every build, so it must be inside the site root and not the site root itself.
passthru[]Files or folders, relative to the site root, copied into outputDir unchanged. An entry that does not exist fails the build.
ignore[]Folders, relative to the site root, to leave out of the build.
minifyfalseRemoves blank lines from HTML output.
tidyHtmlfalseReformats HTML output with jsoup.
baseUrl""Public URL of the site (https://example.com/, https://user.github.io/repo/) or a path prefix (/repo). It must start with http://, https:// or a single / (not //), and contain no ? or #. See Base URL.
permalinks{}Permalink pattern per document type, for example { "post": "/:year/:month/:slug/" }. See Permalink patterns.
taxonomies[]Front matter keys to group documents by, besides tags. See Taxonomies.

minify and tidyHtml apply to HTML output only. Invalid JSON, or a value of the wrong type for one of these keys, fails the build with a message naming the key.

Any other key is kept and can be read in templates through config, for example config.site.title in the starter.

Reserved names:

  • siteRoot, outputPath and __ssg are set by the generator and overwrite a key of the same name in the file.
  • siteUrl and pathPrefix: when the file does not define them, config.siteUrl and config.pathPrefix hold the values derived from baseUrl. When it does, they are kept exactly as written, whatever baseUrl is; links, relUrl(), absUrl() and prc.absoluteUrl still use the values derived from baseUrl.
  • Collection names: collections.all, collections.tags, collections.byTag and collections.global are built in; do not use all, tags, byTag or global as a document type.
  • taxonomies as a document type: with no taxonomies configured, collections.taxonomies is the collection of documents of that type, as in 1.0. With taxonomies configured, a document of type taxonomies fails the build naming the document.

Feed and sitemap

The starter's feed.bxm writes an Atom feed of collections.post, newest first, to /feed.xml, and the layout links it with <link rel="alternate" type="application/atom+xml">. sitemap.bxm writes /sitemap.xml with one entry per HTML page in collections.all, leaving out 404.html. Both use layout: none and excludeFromCollections: true. Their entries link to each document's absoluteUrl; the feed's own rel="self" link is its prc.absoluteUrl, and its site link and <id> come from absUrl( '/' ).

Set baseUrl to the site's public URL before publishing. With the default empty baseUrl, the links in the feed and sitemap are root-relative paths such as /posts/hello-world/, which feed readers and search engines do not accept.