Last updated on Nov 1, 2019.
Every site has a
config.php file. It's the main place for configuration in Systatic.
config.php file looks a bit like this:
<?php return [ 'name' => 'Systatic', 'url' => 'http://localhost:8080', 'locations' => [ 'output' => './dist', 'views' => './views', 'storage' => './storage' ], 'collections' => [ 'pages' => [ 'name' => 'Pages', 'permalink' => '/', 'location' => './content/pages' ] ] ];
Most of the file is pretty self explanatory.
location array has the directory paths for your output, views and your storage.
collections array sets down the collections you want to use within your Systatic site. You can read more about collections configuration here.
Changing the name of the config file
If you don't like the name of the config file, you can change that.
Open up your
systatic file and change the value of the
<?php /* Path to Config - A relative path to where your config file is located. */ $config = './new-config-filename.php'; ....
If you need use something that is specific to each environment or anything that you don't want to be put into keys, you can use environment variables.
All you need to do is create an
.env file, and pop in some key, value pairs.
Then you can easilly refrence them in your templates like this:
.envfile does not exist, we will fallback to a system environment variable for use on systems like Netlify where a file can't be created.