Skip to content

Project configuration

Thane Thomson edited this page Jun 27, 2016 · 3 revisions

There are several parameters that can be configured across a project. These are configured in a file called config.yml in the root of the project directory.

Example

project-name: My project's name
base-path: /
assets:
  source: assets
  dest: static
context:
  static:
    site-title: My Blog
  dynamic:
    authors: session.query(Author).order_by(Author.last_name.asc()).all()

project-name

Some kind of string defining your project's name. This is primarily for informational purposes at present.

base-path

Sometimes you will want to serve your static site from a non-standard root path on your web server (i.e. instead of serving your site from http://somewhere.com/ you may perhaps want to serve it from http://somewhere.com/myblog/). By default, if base-path is /, it means that it will be served from the root of your server (e.g. http://somewhere.com). If it has another value, say /myblog/, all hyperlinks generated by Statik will have this URL component prefixed to it.

assets

This allows you to configure asset-related functionality (i.e. for JavaScript/CSS/image/etc. files that your site may depend on).

source

This defines the source path, relative to your project directory, as to where to find your static asset files. If this value is assets (the default value), then Statik will look for your assets in the /path/to/your/project/assets folder. If, for example, you change this to static, Statik will look for your assets in the /path/to/your/project/static folder.

dest

Similar to the source path, but defines the name of the folder into which you want to save your asset files in your generated static web site. By default, this is also assets, just like the default value for source, so by default your assets will be copied as-is from your source assets folder to /path/to/your/project/public/assets. If you changed this value to, for example, static, your source assets will be copied to the folder /path/to/your/project/public/static.

context

This section defines project-wide context variables for template rendering (variables that will be available to all templates). See the section on Template Variables for more information.

Clone this wiki locally