Versions
When a product has several supported releases, the documentation usually follows. OINK provides two things: a version switcher and an archived version banner.
How each version is deployed is up to you — commonly one subdomain or subpath per version, each built separately.
Version menu
List the versions that should appear in the menu under params.versions:
-
version_menu,string The label on the menu button, usually the current version.
-
versions[].version,string, required The version identifier shown on the menu entry.
-
versions[].url,string, required That version’s documentation address. An entry with no URL renders as unavailable.
-
version_menu_pagelinks,boolean, default:false Whether to append the current page path to the target version’s URL.
Insert a separator with - name: '---' to divide supported from historical
releases:
The page-level switching trade-off
version_menu_pagelinks: true appends the current page path to the target
version’s URL, so a reader switching versions stays on the same document.
The cost is that the target version may not have that page. Documentation structure evolves between releases, an older version may not contain a newly written page, and the reader lands on a 404.
pagelinks: false on an individual entry overrides the global setting so that
version only ever receives its home page.
pagelinks when structure is broadly stable across versions.When it is not, leaving it off is better: an extra click beats a 404.
Archived version banner
On a site for a release you no longer maintain, say so explicitly:
-
archived_version,boolean, default:false When
true, shows an archive notice at the top of every page.-
version,string The version shown in the banner.
-
url_latest_version,string The current version’s address; the banner links to it.
The banner text is localized with the site language; you do not write it.
Deployment layout
Two common arrangements:
| Layout | baseURL |
Character |
|---|---|---|
| Subdomain | https://v1-9.docs.example.com/ |
Fully independent versions |
| Subpath | https://docs.example.com/v1.9/ |
One domain; needs path routing |
baseURL must include that path, orthe search index, page actions, and asset links all point to the wrong place. This is the most common subpath failure.
Each version is built independently: check out the content from its branch
or tag, build with that version’s own hugo.yaml, and publish the output to the
matching address. OINK does not build several versions in one pass.
Next steps
- Languages: combining languages with versions
- Deployment: publishing each version