Settings
The site settings file defines global settings and properties for the website.
In Toucan, it is always located at src/contents/site.yml
(or .yaml
if preferred).
Example
A sample site settings file might look like this:
# required
baseUrl: "http://localhost:3000/"
# optional
locale: "en-US"
# user-defined
name: "Minimal example"
navigation:
- label: "Home"
url: "/"
- label: "About"
url: "/about/"
There are three key types in the settings file: required, optional, and user-defined.
The list below explains each type based on the sample file.
Required keys
These keys must be defined for the website to work properly.
baseUrl
- The base URL of the website.
Specifies the base URL of the website, e.g. https://mywebsite.com/
.
Optional keys
These keys are not required but useful.
locale
- The locale of the website.
Defines the locale of the website, e.g. en-US
(English, US).
See ISO language codes & country codes for more info.
User defined keys
Additional properties for your theme. Here are some examples:
name
- The name of the website.
Sets the name of the website, e.g. “My website”.
navigation
- Sets the main navigation for the website.
Defines the menu items for site navigation. In this case:
- “Home” is linked to the root URL (”/”).
- “About” is linked to the “/docs/” page.
Feel free to add anything to the site settings file. All variables will be available in your theme files under the site key. e.g. {{site.name}}
See the theme guides for more info.