Configure roles
Configure roles.
New in
v0.153.0This 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
}
}
}
Last updated:
February 21, 2026
:
content: Various dimension improvements (b398506dc)
Improve this page