| 1 |
--- |
| 2 |
title: Configure versions |
| 3 |
linkTitle: Versions |
| 4 |
description: Configure versions. |
| 5 |
categories: [] |
| 6 |
keywords: [] |
| 7 |
--- |
| 8 |
|
| 9 |
{{< new-in 0.153.0 />}} |
| 10 |
|
| 11 |
This is the default configuration: |
| 12 |
|
| 13 |
{{< code-toggle config=versions />}} |
| 14 |
|
| 15 |
## Settings |
| 16 |
|
| 17 |
Use the following setting to define how Hugo orders versions. |
| 18 |
|
| 19 |
`weight` |
| 20 |
: (`int`) The language [weight](g). |
| 21 |
|
| 22 |
## Sort order |
| 23 |
|
| 24 |
Hugo sorts versions by weight in ascending order, then by their [semantic version][] in descending order. This affects build order and complement selection. |
| 25 |
|
| 26 |
## Example |
| 27 |
|
| 28 |
The following configuration demonstrates how to define multiple versions with specific weights. |
| 29 |
|
| 30 |
{{< code-toggle >}} |
| 31 |
[versions."v1.0.0"] |
| 32 |
weight = 20 |
| 33 |
[versions."v2.0.0"] |
| 34 |
weight = 10 |
| 35 |
{{< /code-toggle >}} |
| 36 |
|
| 37 |
[semantic version]: https://semver.org/ |