Skip to content

Configuration files

haskelt edited this page Feb 1, 2022 · 10 revisions

Salal is designed to make it easy for you to customize its behavior for your particular use cases. One way this can be done is with configuration files.

Structure of configuration files

Configuration files should be in JSON format, and have two main sections, which are both optional:

  • Globals
  • Parameters

Globals are values that can be substituted into source files. For example, this config file defines a global variable special_style_file.

{
    "globals": { 
        "special_style_file": "/css/style_for_sally.css"
    }
}

This value can then be referenced in a template like this:

<link rel="stylesheet" href="{{globals.special_style_file}}" type="text/css" />

Parameters change how Salal operates. For example, the paths subsection under parameters tells Salal where to look for various files. In the example below, we specify where to look for the user config file (the different kinds of config files are explained more below).

{
    "parameters": {
        "paths": {
            "user_config_file": "~/.salal/user_config.json"
        }
    }
}

Kinds of configuration files

When you run Salal, it will look for 5 different configuration files:

  • System
  • User
  • Theme
  • Project
  • Profile

Only the system config file is required. These configuration files all have the same format, and are processed in the order shown above. A file lower in the list can add new globals or parameters, or override ones that were set in a config file earlier in the sequence.

User configuration

Default location: ~/.salal/user_config.json

This is useful when you have particular kinds of configuration that you use for many projects, and want to avoid putting the same information in every project config file.

Clone this wiki locally