Skip to content

Word Counting

The service WordCounter contains utilities to count words.

Counting words into modules

The setting word-count-config contains global configuration:

json
{
  "contentRoles": [
    <role>,
    <role>,
    ...
  ],
  "fixedRoles": {
    <role>: <int>,
    <role>: <int>,
    ...
  }
}

Where:

  • contentRoles, specify roles where the child content contains the plain text to count word on.
  • fixedRoles, specify roles with a fixed word count.

For example:

json
{
    "contentRoles": [
        "paragraph",
        "supratitle",
        "title"
    ],
    "fixedRoles": {
        "sidebar": 0,
        "tags": 0,
        "main_image": 50,
        "content_image": 50,
        "content_video": 50
    }
}