Most static site generators offer a number of configuration options for use on the command line. Configure these and other CloudCannon-specific build options per site.
To change a command line build option:
- Go to the Site Settings / Build section
- Change details for one or more options
- Click Update Configuration
Using Environment Variables#
Environments allow you to use different values in your website depending on where it is deployed. For example, you could use a different CDN for your development, staging and production sites.
To change the environment variables for your site:
- Go to the Site Settings / Configuration section
- Create/edit your environment key and value under Environment Variables
- Click Update Build Details
CloudCannon defaults to production. Running Jekyll locally defaults to development.
Jekyll exposes the environment with
jekyll.environment. You can use this to create separate configurations.
Here’s a short example using variables from
CloudCannon defaults to production. Running
hugo locally defaults to production. Running
hugo server locally defaults to development.
To change the environment locally, set it before running Hugo:
You can set the Hugo environment using the
—-environment flag in the command line. Learn more about build configuration.
Hugo exposes the environment with
Using a configuration directory allows you to create separate configurations for each environment. See the example in the Hugo documentation.
CloudCannon has no default. You should set your environment variables everywhere you need them before building. The Eleventy documentation mentions
ELEVENTY_ENV as a convention.
To change the environment locally, set it before running Eleventy:
CloudCannon does not set default environment variables for other SSGs.
To change an environment variable locally, set it before running your build command: