Servant

Site settings

To manually define things like the name of your site, page order and favicon, it’s possible to use site settings. Add settings.json in your site’s folder and use the simple syntax.

Site settings are completely optional. Keys are treated case-insensitive, with both singular and plural forms accepted.

settings.json
"languages": "en",
"icons": "icon.png",
"splashImages": "splash.jpg",
"browserCache": "12*60",
"serverCache": "1*60",
"siteNames": {
	"/": "Servant",
	"guides": "Servant Guides",
	"docs": "Servant Docs"
},
"pageNames": {
	"home": "Servant",
	"guides/actions": "Backend actions"
},
"descriptions": {
	"/": "Servant - Effortless publishing for the web",
	"docs, guides": "Documentation, guides and tutorials for the Servant web framework"
},
"stylesheets": {
	"": [
		"https://bitbucket.org/Eiskis/layers-css/raw/default/release/layers.min.css",
		"https://bitbucket.org/Eiskis/layers-css/raw/default/release/responsive.min.css"
	],
	"docs, guides": "http://cdnjs.cloudflare.com/ajax/libs/prism/0.0.1/prism.css"
},
"scripts": {
	"/": "http://code.jquery.com/jquery-2.1.0.min.js",
	"docs, guides": "http://cdnjs.cloudflare.com/ajax/libs/prism/0.0.1/prism.min.js"
},
"templates": {
	"": "servant",
	"docs": "html"
},
"redirects": {
	"author": "http://eiskis.net/",
	"doc": "docs",
	"guide": "guides",
	"recipe": "recipes"
},
"sitemap": [
	"home",
	"guides",
	"guides/get-started",
	"guides/pages",
	"guides/assets",
	"guides/site-settings",
	"guides/templates",
	"guides/actions",
	"docs/basics/about/",
	"docs/basics/asset-pipeline",
	"docs/basics/template-scripting",
	"docs/components/main"
]

Name & icons

Your site’s name will be generated from its folder name, but you can also choose another name in your site’s settings. Templates usually put this name in the site’s header and browser’s title bar. You can also do the same for page names.

Supported setting Example values
siteName
description
icon
Path (relative to Servant root) to an icon image file.
Use .png, .jpg or .ico files.
"favicon.png"
splashImage
Path (relative to Servant root) to an splash image file.
"splash.png"

Sitemap manipulation

You can use the sitemap setting to explicitly set the order of your pages. pageNames can be used to override the automatically generated page names.

Point to any page with its full ID.

Supported setting Example values
pageNames
Custom names to use for your pages.
sitemap
Pages to be prioritized when ordering pages in each category.
redirects
Custom endpoints with corresponding target URLs that Servant will redirect to.

Misc.

Supported setting Example values
browserCache
Suggested caching time for browsers, in minutes.
"3*60", 60
serverCache
Caching time used by Servant, in minutes.
"2*24*60", 180
scripts
URLs of external JS assets to load.
stylesheets
URLs of external CSS assets to load.
language
Two-letter language code, the main language of your site.
"en", "fr"
template
The template under “templates/” to pick for your site.
"default", "mytemplate"