Make the latest API reference page the canonical URL

We host multiple versions of the API reference. While older versions of the
API are still supported by the latest engine release, users should generally
refer to the latest version of the API.

This patch adds a "canonical" meta-tag to the API reference pages, and points
it to the latest version of the API.

Note that there's also a /engine/api/latest/ page, but I didn't pick that
URL, because it's a redirect to `/engine/api/v<current>/`, which Google
probably doesn't like.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2020-09-25 18:10:07 +02:00
parent bc037b7391
commit c3e55377e4

View File

@@ -12,6 +12,8 @@
<link rel="apple-touch-icon" type="image/x-icon" href="/favicons/docs@2x.ico" sizes="129x128" />
<link rel="icon" type="image/x-icon" href="/favicons/docs@2x.ico" sizes="129x128" />
<link rel="stylesheet" type="text/css" href="/css/api-reference.css" />
<!-- make the latest API version the canonical page as that's what we want users to be using mostly -->
<link rel="canonical" href="/engine/api/v{{ site.latest_engine_api_version }}/" />
</head>
<body>
<redoc spec-url="/engine/api/{{ page.name | replace: '.md'}}.yaml" hide-hostname="true" suppress-warnings="true" lazy-rendering></redoc>