Table of contents

Configuration

The website configuration is defined in a YAML file named config.yml, stored at the root (see an example):

<mywebsite>
└─ config.yml

Variables

Example:

title: "My Webiste"
key: "value"

title

Main title of the site.

baseline

Short description (~ 20 characters).

baseurl

Base URL, must end with a trailing slash (/).

Example: http://localhost:8000/.

canonicalurl

If set to true the url() function will return the absolute URL (false by default).

description

Site description (~ 250 characters).

taxonomies

List of vocabularies, paired by plural and singular value.

Example:

taxonomies:
  categories: category

Could be disabled with enabled: false.

menu

Each menu entry should have the following properties:

  • id: unique identifier
  • name: name used in templates
  • url: relative or absolute URL
  • weight: used to sort entries (lighter first)

Example:

menu:
  main:
    about:
      weight: 10
  other:
    author:
      name: "The author"
      url: https://arnaudligny.fr
      weight: 99

A default main menu is created with the home page and sections entries.
Entries can be overrided.

Example:

menu:
  main:
    home:
      id: index
      name: "My amazing homepage!"
      weight: 1

A menu entry can be disabled with enabled: false.

Example:

menu:
  main:
    about:
      enabled: false

pagination

Pagination is avalaible for list pages (if type is homepage, section or term):

  • max: number of pages by paginated page (5 by default)
  • path: path to paginated page (page by default)

Example:

pagination:
  max: 10
  path: "page"

Pagination can be disabled:

pagination:
  enabled: false

date

Date format and timezone:

Example:

date:
  format: "j F Y"
  timezone: "Europe/Paris"

theme

The theme name (sub-directory of themes) or an array of themes.

Example:

theme:
  - serviceworker
  - hyde

googleanalytics

Google Analytics user identifier:

googleanalytics: "UA-XXXXX"

Used by the built-in template partials/googleanalytics.html.twig.

virtualpages

Used to create virtual pages (front matter only):

virtualpages:
  404:
    title: "Page not found"
    layout: 404
    uglyurl: true

output

  • dir: directory where rendered pages are saved (_site by default)
  • formats: array of output formats
    • mediatype: media type (formerly known as MIME type)
    • suffix: filename, ie /index in path/index.html
    • extension: file extension, ie html in path/index.html
  • pagetypeformats: array of gnérated output formats by page type

Example:

output:
  dir: _site
  formats:
    html:
      mediatype: "text/html"
      suffix: "/index"
      extension: "html"
    rss:
      mediatype: "application/rss+xml"
      suffix: "/rss"
      extension: "xml"
      exclude: [redirect, paginated]
  pagetypeformats:
    page: [html]
    homepage: [html, rss]
    section: [html, rss]
    vocabulary: [html]
    term: [html, rss]

content

  • dir: content (pages) directory
  • ext: array of files extensions

frontmatter

  • format: front matter format (yaml by default)

body

  • format: page body format (md, for Markdown, by default)

static

  • dir: static files directory
  • exclude: array of files to exclude from copy

layouts

  • dir: layouts directory

themes

  • dir: themes directory (themes by default)

language

Default language, ie: en.

languages (beta)

Available languages, used by internationalization features.

Example:

languages:
  en:
    name: English
    locale: en_US
  fr:
    name: Français
    locale: fr_FR
    title: 'Cecil in french'

Default values

The local website configuration file owerride those keys if exists: default.php.

Environment variables

Configuration can be defined through environment variables.

For example, the following command will set the website’s baseurl:

export CECIL_BASEURL="https://example.com/"

Name must be prefixed with CECIL_ and the configuration key must be set in uppercase.

Suggest a modification

Templates Commands