From 2a8cd2db2b7d91ab444ad78d46b26e0ccba369d6 Mon Sep 17 00:00:00 2001 From: Sam Barker Date: Tue, 21 Oct 2025 21:20:48 +1300 Subject: [PATCH 1/2] Add redirects for QR codes. Includes adding a `latest` as a special version. Signed-off-by: Sam Barker --- _data/redirects/qr-codes.yaml | 12 ++++++++++++ _plugins/redirector.rb | 12 ++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 _data/redirects/qr-codes.yaml diff --git a/_data/redirects/qr-codes.yaml b/_data/redirects/qr-codes.yaml new file mode 100644 index 00000000..564d62ec --- /dev/null +++ b/_data/redirects/qr-codes.yaml @@ -0,0 +1,12 @@ +baseUrl: /documentation/ +delay: 60 +mappings: + - name: current25-configuring-the-proxy + fromVersion: 0.15.0 + path: /html/kroxylicious-proxy/#assembly-configuring-proxy-proxy + - name: current25-operator + fromVersion: 0.14.0 + path: /html/kroxylicious-operator/ + + + diff --git a/_plugins/redirector.rb b/_plugins/redirector.rb index 6f3c77d8..b6a912ca 100644 --- a/_plugins/redirector.rb +++ b/_plugins/redirector.rb @@ -15,6 +15,10 @@ def generate(site) versions.each { |version| mapping['version'] = version site.pages << RedirectPage.new(site, redirect_config[0], redirect_config[1], mapping) + if version == latest_release + mapping['landing_version'] = "latest" + site.pages << RedirectPage.new(site, redirect_config[0], redirect_config[1], mapping) + end } end Jekyll.logger.info "Generated redirects #{redirect_config[0]}" @@ -34,20 +38,20 @@ def known_releases(site) # Subclass of `Jekyll::Page` with custom method definitions. class RedirectPage < Jekyll::Page - def initialize(site, group, redirectConfig, mapping) + def initialize(site, group, redirect_config, mapping) @site = site # the current site instance. @base = site.source # path to the source directory. - @dir = "/redirect/#{group}/#{mapping['version']}/" # the directory the page will reside in. + @dir = "/redirect/#{group}/#{mapping['landing_version'] || mapping['version']}/" # the directory the page will reside in. # All pages have the same filename, so define attributes straight away. @basename = mapping['name'] # filename without the extension. @ext = '.html' # the extension. @name = basename + ext # basically @basename + @ext. @layout = 'redirect.html' - delay = redirectConfig['delay'] ||= 1 + delay = redirect_config['delay'] ||= 1 @data = { - 'target' => "#{redirectConfig['baseUrl']}#{mapping['version']}#{mapping['path']}", + 'target' => "#{redirect_config['baseUrl']}#{mapping['version']}#{mapping['path']}", 'layout' => 'redirect', 'delay' => "#{delay}", } From 3716b0149ae90d56fdf373e4efae5977d20c871b Mon Sep 17 00:00:00 2001 From: Sam Barker Date: Wed, 22 Oct 2025 11:36:54 +1300 Subject: [PATCH 2/2] Reduce delay from the debugging value Signed-off-by: Sam Barker --- _data/redirects/qr-codes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/redirects/qr-codes.yaml b/_data/redirects/qr-codes.yaml index 564d62ec..9bf65781 100644 --- a/_data/redirects/qr-codes.yaml +++ b/_data/redirects/qr-codes.yaml @@ -1,5 +1,5 @@ baseUrl: /documentation/ -delay: 60 +delay: 0 mappings: - name: current25-configuring-the-proxy fromVersion: 0.15.0