Skip to content

Commit 461b3aa

Browse files
committed
Introduce configurable delays and improve styling.
Signed-off-by: Sam Barker <[email protected]>
1 parent 3740869 commit 461b3aa

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

_data/redirects/errors.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
baseUrl: https://kroxylicious.io/documentation/
2+
delay: 3
23
mappings:
34
- name: suspectedTls
45
fromVersion: 0.13.0

_layouts/redirect.html

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,29 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<meta http-equiv="refresh" content="0; url={{ page.target }}">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>{% if page.title %}{{ page.title }} | {% endif %}{{ site.title }} | {{ site.description }}</title>
7+
<link rel="icon" href="{{ '/favicon.ico' | absolute_url }}" type="image/x-icon"/>
8+
<link rel="stylesheet" href="{{ '/css/style.css' | absolute_url }}"/>
9+
<link rel="stylesheet"
10+
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.1/font/bootstrap-icons.min.css"
11+
integrity="sha512-oAvZuuYVzkcTc2dH5z1ZJup5OmSQ000qlfRvuoTTiyTBjwX1faoyearj8KdMq0LgsBTHMrRuMek7s+CxF8yE+w=="
12+
crossorigin="anonymous" referrerpolicy="no-referrer"/>
13+
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js"
14+
integrity="sha512-X/YkDZyjTf4wyc2Vy16YGCPHwAY8rZJY+POgokZjQB2mhIRFJCckEGc6YyX9eNsPfn0PzThEuNs+uaomE5CO6A=="
15+
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
16+
<meta http-equiv="refresh" content="{{ page.delay }}; url={{ page.target }}">
617
</head>
7-
<body>
8-
Redirecting to <a href="{{ page.target }}">{{ page.target }}</a>...
18+
<body class="d-flex flex-column min-vh-100" data-bs-theme="light">
19+
{% include nav.html %}
20+
<div class="container-fluid px-0 krx-content" data-bs-theme="light">
21+
<div class="paragraph" role="main">
22+
<div>Redirecting to <a href="{{ page.target }}">{{ page.target }}</a>...</div>
23+
<div class="spinner-border text-success" role="status">
24+
<span class="visually-hidden">Loading...</span>
25+
</div>
26+
</div>
27+
</div>
28+
{% include footer.html %}
929
</body>
10-
</html>
30+
<body>

_plugins/redirector.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ def initialize(site, group, redirectConfig, mapping)
4545
@ext = '.html' # the extension.
4646
@name = basename + ext # basically @basename + @ext.
4747
@layout = 'redirect.html'
48-
48+
delay = redirectConfig['delay'] ||= 1
4949
@data = {
5050
'target' => "#{redirectConfig['baseUrl']}#{mapping['version']}#{mapping['path']}",
51-
'layout' => 'redirect'
51+
'layout' => 'redirect',
52+
'delay' => "#{delay}",
5253
}
5354

5455
Jekyll.logger.info "generated redirect from #{@dir}#{@basename} to #{data['target']}"

0 commit comments

Comments
 (0)