mirror of
https://github.com/docker/docs.git
synced 2026-03-31 08:18:55 +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>
12 lines
456 B
HTML
12 lines
456 B
HTML
<!DOCTYPE html>
|
|
<html lang="en-US">
|
|
<meta charset="utf-8">
|
|
<title>Redirecting…</title>
|
|
<link rel="canonical" href="https://docs.docker.com{{ page.redirect.to }}">
|
|
<meta http-equiv="refresh" content="0; url={{ page.redirect.to }}">
|
|
<meta name="robots" content="noindex">
|
|
<h1>Redirecting…</h1>
|
|
<a href="{{ page.redirect.to }}">Click here if you are not redirected.</a>
|
|
<script>location="{{ page.redirect.to }}"</script>
|
|
</html>
|