From 3c869fb0e354980753ec641bb0124aba5209e0f6 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 21 Oct 2020 14:17:37 +0200 Subject: [PATCH] _layouts: fix redirect layout for external URLs This allows `redirect_to` redirects to external websites; curl localhost:4000/samples/library/adminer/ Redirecting…

Redirecting…

Click here if you are not redirected. Signed-off-by: Sebastiaan van Stijn --- _layouts/redirect.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/_layouts/redirect.html b/_layouts/redirect.html index e5c382d1e7..3b9cece79e 100644 --- a/_layouts/redirect.html +++ b/_layouts/redirect.html @@ -2,10 +2,15 @@ Redirecting… - - + {%- assign redirect_to = page.redirect.to | remove_first: 'https://docs.docker.com' | remove_first: 'http://docs.docker.com' %} + {%- if redirect_to contains "://" %} + + {%- else %} + + {%- endif %} +

Redirecting…

- Click here if you are not redirected. - + Click here if you are not redirected. +