Files
docker-docs/_layouts/redirect.html
Sebastiaan van Stijn 3c869fb0e3 _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&hellip;</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&hellip;</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>
2020-10-21 15:09:14 +02:00

17 lines
684 B
HTML

<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting&hellip;</title>
{%- 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&hellip;</h1>
<a href="{{ redirect_to }}">Click here if you are not redirected.</a>
<script>location="{{ redirect_to }}"</script>
</html>