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": []
}
| Key | Default | Meaning |
|---|---|---|
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. |
minify | false | Removes blank lines from HTML output. |
tidyHtml | false | Reformats 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,outputPathand__ssgare set by the generator and overwrite a key of the same name in the file.siteUrlandpathPrefix: when the file does not define them,config.siteUrlandconfig.pathPrefixhold the values derived frombaseUrl. When it does, they are kept exactly as written, whateverbaseUrlis; links,relUrl(),absUrl()andprc.absoluteUrlstill use the values derived frombaseUrl.- Collection names:
collections.all,collections.tags,collections.byTagandcollections.globalare built in; do not useall,tags,byTagorglobalas a document type. taxonomiesas a document type: with notaxonomiesconfigured,collections.taxonomiesis the collection of documents of that type, as in 1.0. Withtaxonomiesconfigured, a document of typetaxonomiesfails 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.