microsite: add links page with stable links to various places

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-01-14 11:04:12 +01:00
parent 1f65b3752e
commit 2ff3f1d3bf
+27
View File
@@ -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;