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

Website

Configuration variables available in templates are set under the site key.

Example:

site:
  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:

site:
  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:

site:
  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:

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

A menu entry can be disabled with enabled: false.

Example:

site:
  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:

site:
  pagination:
    max: 10
    path: "page"

Pagination can be disabled:

site:
  pagination:
    enabled: false

date

Date format and timezone:

Example:

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

googleanalytics

Google Analytics user identifier:

site:
  googleanalytics: "UA-XXXXX"

Use by default template partials/googleanalytics.html.twig.

virtualpages

Used to create virtual pages (front matter only):

site:
  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]

Global

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)

theme

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

Example:

theme:
  - serviceworker
  - hyde

Default

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 a website’s title:

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

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

Suggest a modification

Templates Commands