Skip to main content

The theme manifest

Every theme has a theme.json file at its top level. It names the theme, says which version of the theme contract it is written for, and lists its options.

{
    "name": "Acme Docs",
    "version": "1.0.0",
    "author": "Acme Inc.",
    "contract": "^1.0",
    "options": [
        {
            "key": "accent",
            "type": "color",
            "label": "Accent color",
            "description": "Links, buttons and the portal banner.",
            "default": "#3a46e8"
        }
    ],
    "i18n": { "sourceLanguage": "en" }
}

Field

Required

Description

name

Yes

The theme's name. It is used in the name of the downloaded ZIP file.

version

Yes

The theme's version. Use a version number such as 1.0.0; anything else gives a warning.

contract

Yes

The versions of the theme contract the theme works with. Use "^1.0".

author

No

Who made the theme.

options

No

The settings the theme offers in the Layout Editor. See Theme options reference.

i18n

No

sourceLanguage names the translation file used when a text has no translation in the page's language. The default is en. See Translate a theme.

The contract

The theme contract is the set of variables, functions and rules that Paligo gives templates, as described in this section. Its current version is 1.0. The contract field says which versions your theme works with, so that a later, incompatible version of the contract can't break a published theme.

Use "^1.0", which means any 1.x version. These forms are also accepted:

Form

Means

"1.0"

Exactly 1.0

"^1.0" or "^1"

Any 1.x version

"~1.0"

Any 1.0.x version

"1.x"

Any 1.x version

"*"

Any version

"^1.0 || ^2.0"

Either range

Comparisons such as ">=1.0" are not accepted.