mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
_layouts: fix redirect layout for external URLs
This allows `redirect_to` redirects to external websites;
curl localhost:4000/samples/library/adminer/
<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting…</title>
<link rel="canonical" href="https://hub.docker.com/_/adminer/"><meta http-equiv="refresh" content="0; url=https://hub.docker.com/_/adminer/">
<meta name="robots" content="noindex">
<h1>Redirecting…</h1>
<a href="https://hub.docker.com/_/adminer/">Click here if you are not redirected.</a>
<script>location="https://hub.docker.com/_/adminer/"</script>
</html>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -2,10 +2,15 @@
|
||||
<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 }}">
|
||||
{%- assign redirect_to = page.redirect.to | remove_first: 'https://docs.docker.com' | remove_first: 'http://docs.docker.com' %}
|
||||
{%- if redirect_to contains "://" %}
|
||||
<link rel="canonical" href="{{ redirect_to }}">
|
||||
{%- else %}
|
||||
<link rel="canonical" href="https://docs.docker.com{{ redirect_to }}">
|
||||
{%- endif %}
|
||||
<meta http-equiv="refresh" content="0; url={{ 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>
|
||||
<a href="{{ redirect_to }}">Click here if you are not redirected.</a>
|
||||
<script>location="{{ redirect_to }}"</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user