microsite: add links page with stable links to various places
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
const React = require('react');
|
||||
|
||||
// This is an index of stable short-links to different doc sites
|
||||
// for example https://backstage.io/link?bind-routes
|
||||
const redirects = {
|
||||
'bind-routes':
|
||||
'/docs/plugins/composability#binding-external-routes-in-the-app',
|
||||
};
|
||||
const fallback = '/docs';
|
||||
|
||||
function Link() {
|
||||
return (
|
||||
<html lang="en">
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
const redirects = ${JSON.stringify(redirects)};
|
||||
const target = redirects[window.location.search.slice(1)] || '${fallback}';
|
||||
window.location.href = target;
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = Link;
|
||||
Reference in New Issue
Block a user