1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/website/remote-content/edge-proxy.js
Gastón Fournier fc02581a10
docs: add subpages of edge documentation (#7720)
When all edge documentation was in a single page, we had all of it here:
https://docs.getunleash.io/reference/unleash-edge but after splitting up
https://github.com/Unleash/unleash-edge/pull/475 some of that
documentation is not present in our docs and we should probably have
them as sub-pages

This change allows us to include subpages for external documentation.
Note that the key of the subpage needs to match the remote path

Checkout the preview:
https://unleash-docs-git-add-edge-subpages-unleash-team.vercel.app/

![image](https://github.com/user-attachments/assets/4b87fe25-fca6-4995-b296-aa58caab4f62)

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2024-08-01 14:48:58 +02:00

53 lines
1.2 KiB
JavaScript

const {
enrich,
mapObject,
modifyContent,
getRepoData,
getUrls,
} = require('./shared');
const DOCS = mapObject(enrich)({
'unleash-proxy': {
sidebarName: 'Unleash Proxy',
slugName: 'unleash-proxy',
},
'unleash-edge': {
sidebarName: 'Unleash Edge',
slugName: 'unleash-edge',
subPages: {
'docs/concepts.md': {
sidebarName: 'Concepts',
slugName: 'concepts',
},
'docs/deploying.md': {
sidebarName: 'Deploying',
slugName: 'deploying',
},
},
},
});
const getAdmonitions = (data) => {
const admonitions = {
'unleash-proxy': `:::tip
Looking for how to run the Unleash proxy? Check out the [_how to run the Unleash proxy_ guide](../how-to/how-to-run-the-unleash-proxy.mdx)!
:::`,
'unleash-edge': ``,
};
return [admonitions[data.slugName]];
};
const modifyContent2 = modifyContent({
getRepoDataFn: getRepoData(DOCS),
urlPath: '/reference/',
getAdditionalAdmonitions: getAdmonitions,
});
module.exports.docs = {
urls: getUrls(DOCS),
modifyContent: modifyContent2,
};