HUGO
Menu
GitHub 86757 stars Mastodon

Configure versions

Configure versions.
New in v0.153.0

This is the default configuration:

versions:
  v1.0.0:
    weight: 0
[versions]
  [versions.'v1.0.0']
    weight = 0
{
   "versions": {
      "v1.0.0": {
         "weight": 0
      }
   }
}

Settings

Use the following setting to define how Hugo orders versions.

weight
(int) The language weight.

Sort order

Hugo sorts versions by weight in ascending order, then by their semantic version in descending order. This affects build order and complement selection.

Example

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

versions:
  v1.0.0:
    weight: 20
  v2.0.0:
    weight: 10
[versions]
  [versions.'v1.0.0']
    weight = 20
  [versions.'v2.0.0']
    weight = 10
{
   "versions": {
      "v1.0.0": {
         "weight": 20
      },
      "v2.0.0": {
         "weight": 10
      }
   }
}