HUGO
Menu
GitHub 86757 stars Mastodon

Configure roles

Configure roles.
New in v0.153.0

This is the default configuration:

roles:
  guest:
    weight: 0
[roles]
  [roles.guest]
    weight = 0
{
   "roles": {
      "guest": {
         "weight": 0
      }
   }
}

Settings

Use the following setting to define how Hugo orders roles.

weight
(int) The role weight.

Sort order

Hugo sorts roles by weight in ascending order, then lexicographically in ascending order. This affects build order and complement selection.

Example

The following configuration demonstrates how to define multiple roles with specific weights.

roles:
  guest:
    weight: 20
  member:
    weight: 10
[roles]
  [roles.guest]
    weight = 20
  [roles.member]
    weight = 10
{
   "roles": {
      "guest": {
         "weight": 20
      },
      "member": {
         "weight": 10
      }
   }
}