mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
Canonical links are expected to be full URLs, not relative.
For this to work, the Dockerfile had to be updated, because we're stripping
the domain-name from links ("<a href..."), but the script currently also included
"<link rel='canonical' .." tags.
With the change, canonical links are left alone;
These hrefs will be replaced
echo '<a class=foo href="https://docs.docker.com/foo">hello</a>' | sed -e 's#\(<a[^>]* href="\)https://docs.docker.com/#\1/#g'
# <a class=foo href="/foo">hello</a>
echo '<a href="https://docs.docker.com/foo">hello</a>' | sed -e 's#\(<a[^>]* href="\)https://docs.docker.com/#\1/#g'
# <a href="/foo">hello</a>
But, for example, this one is left alone
echo '<link rel="canonical" href="https://docs.docker.com/foo/bar" />' | sed -e 's#\(<a[^>]* href="?\)https://docs.docker.com/#\1/#g'
# <link rel="canonical" href="https://docs.docker.com/foo/bar" />
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
23 lines
1.3 KiB
HTML
23 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Docker Engine API {{ page.name | replace: '.md' }} Reference</title>
|
|
<!-- needed for adaptive design -->
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="description" content="Reference documentation and Swagger (OpenAPI) specification for the v{{ page.name | replace: '.md' }} version of the API served by Docker Engine." />
|
|
<meta charset="utf-8" />
|
|
<!-- favicon -->
|
|
<meta name="msapplication-TileImage" content="/favicons/docs@2x.ico" />
|
|
<meta property="og:image" content="/favicons/docs@2x.ico" />
|
|
<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="https://docs.docker.com/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>
|
|
<script src="/js/redoc.min.js"></script>
|
|
</body>
|
|
</html>
|