-
Notifications
You must be signed in to change notification settings - Fork 0
Global variables
For relatively simple projects, it may be sufficient to just use template files, content files, and resources. However, to unlock some of the more powerful features of Salal, you will also need to use configuration files.
And it can sometimes be useful even when the value is consistent across profiles. For example, suppose all pages of a particular type should load a given CSS file. You could hard-code the URL for the CSS file in your page template. However, it may be better for maintainability to use a project variable instead. You can put something like this in your template:
<link rel="stylesheet" href="{{globals.special_style_file}}" type="text/css" />
And then put this in your project config file:
{
"globals": {
"special_style_file": "/css/style_for_sally.css"
}
}
Within each section of the file, you can have a system subsection and a project subsection. Both are optional. The system subsection is for variables that control how Salal operates. The project subsection is for variables that you want available to the templating engine as your site is being built. A brief example will help illustrate the typical use of each.
You may have a set of templates, CSS styles, or other design elements that you'd like to be able to use on multiple sites. Salal supports that through the use of Themes. You tell Salal to use a particular theme for your project by defining a system variable theme_root, which points to the directory where the theme files can be found:
common
|---system
|---paths
|---theme_root: /home/mario/my_themes/cool_design"
- Home
- About Salal
- Installation
- Tutorials
- Core concepts
- Getting more out of Salal
- Advanced topics
- Change log