-
-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 Unleash/unleash-edge#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/  --------- Co-authored-by: Thomas Heartman <thomas@getunleash.io>
- Loading branch information
1 parent
bbefff5
commit fc02581
Showing
5 changed files
with
78 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const { docs } = require('./edge-proxy'); | ||
|
||
test('Should get all sub pages', () => { | ||
expect(docs.urls).toStrictEqual([ | ||
'unleash-proxy/main/README.md', | ||
'unleash-edge/main/README.md', | ||
'unleash-edge/main/docs/concepts.md', | ||
'unleash-edge/main/docs/deploying.md', | ||
]); | ||
}); | ||
|
||
test('Modifies filenames and content properly', () => { | ||
const proxyContent = docs.modifyContent(docs.urls[0], ''); | ||
const edgeMainContent = docs.modifyContent(docs.urls[1], ''); | ||
const firstSubpage = docs.modifyContent(docs.urls[2], ''); | ||
const secondSubpage = docs.modifyContent(docs.urls[3], ''); | ||
|
||
expect(proxyContent.filename).toBe('unleash-proxy.md'); | ||
expect(edgeMainContent.filename).toBe('unleash-edge.md'); | ||
expect(firstSubpage.filename).toBe('unleash-edge/concepts.md'); | ||
expect(secondSubpage.filename).toBe('unleash-edge/deploying.md'); | ||
|
||
expect(edgeMainContent.content).toContain('title: Unleash Edge'); | ||
expect(edgeMainContent.content).toContain('slug: /reference/unleash-edge'); | ||
expect(edgeMainContent.content).toContain( | ||
'custom_edit_url: https://github.com/Unleash/unleash-edge/edit/main/README.md', | ||
); | ||
|
||
expect(firstSubpage.content).toContain('title: Concepts'); | ||
expect(firstSubpage.content).toContain( | ||
'slug: /reference/unleash-edge/concepts', | ||
); | ||
expect(firstSubpage.content).toContain( | ||
'custom_edit_url: https://github.com/Unleash/unleash-edge/edit/main/docs/concepts.md', | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters