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>
jekyll-redirect-from v0.12.1 causes "Liquid Exception: invalid byte sequence in US-ASCII in _layouts/redirect.html"
-override default built-in redirect.html with a custom "_layouts/redirect.html" that has the ellipsis HTML fix encoded localy