Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions _data/redirects/qr-codes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
baseUrl: /documentation/
delay: 0
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 0.14.0?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First version the guide appeared in but 0.16.0 is all I need to work right now.

path: /html/kroxylicious-operator/



12 changes: 8 additions & 4 deletions _plugins/redirector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]}"
Expand All @@ -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}",
}
Expand Down