Allow static redirect page to be customized using a UI template
Allow the static redirect page to be customized using a Handlebars template loaded from the UI bundle.
Currently, the template used to generate a static redirect page for an alias (when the redirect facility is static) is baked in. Here's the contents of that template:
<!DOCTYPE html>
<meta charset="utf-8">${canonicalLink}
<script>location="${relativeUrl}"</script>
<meta http-equiv="refresh" content="0; url=${relativeUrl}">
<meta name="robots" content="noindex">
<title>Redirect Notice</title>
<h1>Redirect Notice</h1>
<p>The page you requested has been relocated to <a href="${relativeUrl}">${canonicalUrl || relativeUrl}</a>.</p>
However, site authors may want to be able to control the content of this page. The redirect producer should look for a template named redirect.hbs in the UI bundle and, if present, use it instead.
The UI model for this template should be as follows:
url - the absolute URL path to the target page
relativeUrl - the relative URL path to the target page
canonicalUrl - the fully-qualified redirect URL; only set if the playbook defines site.url
redirectFacility - the facility that provides the redirect behavior
We may want to use the template even when the redirect facility is not static. This would allow the site author to control how the rewrite rules are generated. The template would be able to differentiate between the facility by consulting the redirectFacility
template variable. If necessary, this part can be moved to a separate issue.