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 exposed to layouts is 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 must have the following items:

  • id: unique identifier
  • name: name used in layouts
  • url: relative or absolute URL
  • weight: used to order entries

Example:

site:
  menu:
    main:
      about:
        id: 'about'
        weight: 10
    other:
      narno:
        id: 'narno'
        name: 'narno.org'
        url: https://narno.org
        weight: 99

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

Example:

site:
  menu:
    main:
      index:
        id: 'index'
        name: 'Homepage'
        url: /
        weight: 1

A menu entry can be disabled with enabled: false.

Example:

site:
  menu:
    main:
      about:
        id: 'about'
        enabled: false

pagination

Pagination is avalaible for list pages (homepage, sections, etc.):

  • max: number of pages by paginated page
  • 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:

  • format: The format specifier is the same as supported by date
  • timezone: The date timezone

Example:

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

googleanalytics

Google Analytics user identifier.

site:
  googleanalytics: 'UA-XXXXX'

virtualpages

Used to create virtual pages (without body, 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
  • pagetypeformats: array of output formats by page type

Example:

formats:
  html:
    mediatype: 'text/html'
    suffix: '/index'
    extension: 'html'
  rss:
    mediatype: 'application/rss+xml'
    suffix: '/rss'
    extension: 'xml'
    exclude: ['redirect', 'paginated']
  json:
    mediatype: 'application/json'
    extension: 'json'
    exclude: ['redirect']
  xml:
    mediatype: 'application/xml'
    extension: 'xml'
    exclude: ['redirect']
  txt:
    mediatype: 'text/plain'
    extension: 'txt'
    exclude: ['redirect']
  amp:
    mediatype: 'text/html'
    subpath: '/amp'
    suffix: '/index'
    extension: 'html'
pagetypeformats:
  page: ['html', 'json']
  homepage: ['html', 'rss', 'json']
  section: ['html', 'rss', 'json']
  taxonomy: ['html', 'rss']
  terms: ['html']

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 (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_TITLE="Some Title"

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

Suggest a modification Next