<commit_before><!--
description: "Configure your website."
date: 2021-05-07
updated: 2021-11-26
-->

# Configuration

The website configuration is defined in a [YAML](https://en.wikipedia.org/wiki/YAML) file (named `config.yml` by default) stored at the root:

```plaintext
<mywebsite>
└─ config.yml
```

_Example:_

```yaml
title: "Cecil"
baseline: "Your content driven static site generator."
baseurl: https://cecil.local/
language: en
```

## Variables

### title

Main title of the site.

```yaml
title: "<title>"
```

### baseline

Short description (~ 20 characters).

```yaml
baseline: "<baseline>"
```

### baseurl

The base URL. Must end with a trailing slash (`/`).

```yaml
baseurl: "<baseurl>"
```

_Example:_

```yaml
baseurl: http://localhost:8000/
```

### canonicalurl

If set to `true` the [`url()`](3-Templates.md#url) function will return the absolute URL (`false` by default).

```yaml
canonicalurl: false
```

### description

Site description (~ 250 characters).

```yaml
description: <description>
```

### date

Date format and timezone:

```yaml
date:
  format: '<format>'     # date format (`j F Y` by default)
  timezone: '<timezone>' # date timezone (`Europe/Paris` by default)
```

- `format`: [PHP date](https://php.net/date) format specifier
- `timezone`: see [timezones](https://php.net/timezones)

_Example:_

```yaml
date:
  format: 'Y-m-d'
  timezone: 'UTC'
```

### taxonomies

List of vocabularies, paired by plural and singular value.

```yaml
taxonomies:
  <plural>: <singular>
```

_Default taxonomies:_

```yaml
taxonomies:
  categories: category
  tags: tag
```

A vocabulary can be disabled with the special value `disabled`:

```yaml
taxonomies:
  tags: disabled
```

### menus

A menu is made up of a unique name and entry’s properties:

```yaml
menus:
  <name>:
    - id: <unique_id> # unique identifier (required)
      name: "<name>"  # name used in templates
      url: <url>      # relative or absolute URL
      weight: <XX>    # used to sort entries (lighter first)
```

By default a `main` menu is created and contains the home page and sections entries.

_Example:_

```yaml
menus:
  footer:
    - id: author
      name: "The author"
      url: https://arnaudligny.fr
      weight: 99
```

#### Override entry properties

A page menu entry can be overridden: use the _Page_ ID as `id`.

_Example:_

```yaml
menus:
  main:
    - id: index
      name: "My amazing homepage!"
      weight: 1
```

#### Disable an entry

A menu entry can be disabled with `enabled: false`.

_Example:_

```yaml
menus:
  main:
    - id: about
      enabled: false
```

### metatags

[_Meta tags_](https://wikipedia.org/wiki/Meta_element) (for SEO) can be injected automatically in the `<head>` by including the [`partials/metatags.html.twig`](https://github.com/Cecilapp/Cecil/blob/master/resources/layouts/partials/metatags.html.twig) template:

```twig
{{ include('partials/metatags.html.twig') }}
```

*[SEO]: Search Engine Optimization

Cecil uses data from pages front matter and fallbacks to the configuration to feed meta tags:

```yaml<commit_msg>Update 4-Configuration.md<commit_after><!--
description: "Configure your website."
date: 2021-05-07
updated: 2021-11-26
-->

# Configuration

The website configuration is defined in a [YAML](https://en.wikipedia.org/wiki/YAML) file (named `config.yml` by default) stored at the root:

```plaintext
<mywebsite>
└─ config.yml
```

_Example:_

```yaml
title: "Cecil"
baseline: "Your content driven static site generator."
baseurl: https://cecil.local/
language: en
```

## Variables

### title

Main title of the site.

```yaml
title: "<title>"
```

### baseline

Short description (~ 20 characters).

```yaml
baseline: "<baseline>"
```

### baseurl

The base URL. Must end with a trailing slash (`/`).

```yaml
baseurl: "<baseurl>"
```

_Example:_

```yaml
baseurl: http://localhost:8000/
```

### canonicalurl

If set to `true` the [`url()`](3-Templates.md#url) function will return the absolute URL (`false` by default).

```yaml
canonicalurl: false
```

### description

Site description (~ 250 characters).

```yaml
description: <description>
```

### date

Date format and timezone:

```yaml
date:
  format: '<format>'     # date format (`j F Y` by default)
  timezone: '<timezone>' # date timezone (`Europe/Paris` by default)
```

- `format`: [PHP date](https://php.net/date) format specifier
- `timezone`: see [timezones](https://php.net/timezones)

_Example:_

```yaml
date:
  format: 'Y-m-d'
  timezone: 'UTC'
```

### taxonomies

List of vocabularies, paired by plural and singular value.

```yaml
taxonomies:
  <plural>: <singular>
```

_Default taxonomies:_

```yaml
taxonomies:
  categories: category
  tags: tag
```

A vocabulary can be disabled with the special value `disabled`:

```yaml
taxonomies:
  tags: disabled
```

### menus

A menu is made up of a unique name and entry’s properties:

```yaml
menus:
  <name>:
    - id: <unique_id> # unique identifier (required)
      name: "<name>"  # name used in templates
      url: <url>      # relative or absolute URL
      weight: <XX>    # used to sort entries (lighter first)
```

By default a `main` menu is created and contains the home page and sections entries.

_Example:_

```yaml
menus:
  footer:
    - id: author
      name: "The author"
      url: https://arnaudligny.fr
      weight: 99
```

#### Override entry properties

A page menu entry can be overridden: use the _Page_ ID as `id`.

_Example:_

```yaml
menus:
  main:
    - id: index
      name: "My amazing homepage!"
      weight: 1
```

#### Disable an entry

A menu entry can be disabled with `enabled: false`.

_Example:_

```yaml
menus:
  main:
    - id: about
      enabled: false
```

### metatags

[_Meta tags_](https://wikipedia.org/wiki/Meta_element) (for SEO) can be injected automatically in the `<head>` by including the [`partials/metatags.html.twig`](https://github.com/Cecilapp/Cecil/blob/master/resources/layouts/partials/metatags.html.twig) template:

```twig
{{ include('partials/metatags.html.twig') }}
```

*[SEO]: Search Engine Optimization

This template adds the following meta tags to your site:

- Page title, with site title or baseline appended
- Page description
- Page keywords
- Page author
- Search engine crawler directives
- Favicon links
- Previous / Next page links
- Pagination links
- Canonical URL
- Link to alternates formats (ie: RSS feed)
- Open Graph
- Twitter Card
- JSON-LD site and post metadata

Cecil uses data from pages front matter and fallbacks to the configuration to feed meta tags:

```yaml
{'fraction_non_alphanumeric': 0.14592536176694593, 'fraction_numerical': 0.008987052551408987, 'mean_word_length': 3.852919438285292, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2813950', 'n_tokens_mistral': 2301, 'n_tokens_neox': 2118, 'n_words': 732}