Support link-modules and add docs link (#368)

* Allow link type modules

* Add docs module

* Allow buttons to render as <a>

* Update button readme

* Use link buttons in module sidebar when needed
This commit is contained in:
Rijk van Zanten
2020-04-09 10:23:07 -04:00
committed by GitHub
parent f2034f7ade
commit 7a2ee0215f
9 changed files with 55 additions and 16 deletions

View File

@@ -13,17 +13,19 @@ export function defineModule(
options = config;
}
options.routes = options.routes.map((route) => {
if (route.path) {
route.path = `/:project/${options.id}${route.path}`;
}
if (options.routes !== undefined) {
options.routes = options.routes.map((route) => {
if (route.path) {
route.path = `/:project/${options.id}${route.path}`;
}
if (route.redirect) {
route.redirect = `/:project/${options.id}${route.redirect}`;
}
if (route.redirect) {
route.redirect = `/:project/${options.id}${route.redirect}`;
}
return route;
});
return route;
});
}
return options;
}