<commit_before># crate-web

This is the content repository for the [crate.io](https://crate.io) website.

The content is built into a static website using the static website generator
tool [Cactus](https://github.com/koenbok/Cactus).

The build tool can be found in the repo [crate/crate-cactus](https://github.com/crate/crate-cactus).

**Happy writing!**


## Plugins

The `crate-web` Cactus site contains following plugins:

* `collection.py`
* `events.py`

### Collection

Collections are groups of pages within a certain common path,
e.g. the blog collection is located in `./pages/blog`.

Collections are configured in the `config.json`. Collection objects must contain
following key-value pairs: `title` (name of the collection), `path` (directory
in which pages for this collection are located), `template` (default template for
pages).
The `order` object is optional and must contain `key` and `reverse` if present,
where `key` is the header after which should be sorted.

```json
{
  ...
  "collections": {
    "blog": {
      "title": "Blog",
      "path": "blog/",
      "template": "post.html",
      "order": {
        "key": "date",
        "reverse": true<commit_msg>added description for using table of contents<commit_after># crate-web

This is the content repository for the [crate.io](https://crate.io) website.

The content is built into a static website using the static website generator
tool [Cactus](https://github.com/koenbok/Cactus).

The build tool can be found in the repo [crate/crate-cactus](https://github.com/crate/crate-cactus).

**Happy writing!**


## Plugins

The `crate-web` Cactus site contains following plugins:

* `collection.py`
* `events.py`

### Collection

Collections are groups of pages within a certain common path,
e.g. the blog collection is located in `./pages/blog`.

Collections are configured in the `config.json`. Collection objects must contain
following key-value pairs: `title` (name of the collection), `path` (directory
in which pages for this collection are located), `template` (default template for
pages).
The `order` object is optional and must contain `key` or `file` and `reverse` if present,
where `key` is the header after which should be sorted.  
The `file` attribute receives an absolute or relative file path to a file that 
contains the table of contents (toc). The order of the sites is defined as they 
are listed in the toc-file.

`doc/toc`
```
index.html
docs/faq.html
docs/clients.html
```

`config.json`
```json
{
  ...
  "collections": {
    "blog": {
      "title": "Blog",
      "path": "blog/",
      "template": "post.html",
      "order": {
        "key": "date",
        "reverse": true
      }
    },
    "doc": {
      "title": "Doc",
      "path": "doc/",
      "template": "doc.html",
      "order": {
        "file": "doc/toc",
{'fraction_non_alphanumeric': 0.12912380276693863, 'fraction_numerical': 0.0, 'mean_word_length': 3.563106796116505, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '5762584', 'n_tokens_mistral': 850, 'n_tokens_neox': 848, 'n_words': 330}