Skip to content

Commit 97c7cd0

Browse files
committed
Changes to homepage, added auto generated sidebars, and new folder structure to CMS.
1 parent 43e97f9 commit 97c7cd0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+952
-1956
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ module.exports = (ctx) => ({
112112
sidebar: {
113113
'/api/reference/rest/': sidebar.rest(),
114114
'/api/guides/': sidebar.guides(),
115+
'/': sidebar.support(),
115116
},
116117
// sidebar: {
117118
// '/api/guides/': [{

docs/.vuepress/nav/left/guides.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ const tutorials = require('./guides/tutorials.js');
44
const best_practices = require('./guides/best-practices.js');
55

66

7+
const overview = {
8+
title: 'Overview',
9+
collapsable: false,
10+
sidebarDepth: 0,
11+
children: [
12+
['/api/guides/', 'Settle API Overview'],
13+
],
14+
}
15+
716
module.exports = [
17+
overview,
818
introduction,
919
quickstarts,
1020
tutorials,
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
const {
2+
fs,
3+
path
4+
} = require('@vuepress/shared-utils')
5+
6+
const introductionBestPrac = fs
7+
.readdirSync(path.resolve(__dirname, '../../../../api/guides/best-practices'))
8+
.map(filename => 'best-practices/' + filename.slice(0, -3))
9+
.sort()
10+
111
module.exports = {
212
title: 'Best Practices', // required
313
collapsable: false,
414
sidebarDepth: 0,
5-
children: [
6-
['/api/guides/best-practices/', 'Overview']
7-
],
15+
children: introductionBestPrac
816
};

docs/.vuepress/nav/left/guides/introduction.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,11 @@ const {
33
path
44
} = require('@vuepress/shared-utils')
55

6-
const officalPlugins = fs
7-
.readdirSync(path.resolve(__dirname, '../../../../api/guides/introduction'))
8-
.map(filename => 'introduction/' + filename.slice(0, -3))
9-
.sort()
6+
const introductionDocs = fs.readdirSync(path.resolve(__dirname, '../../../../api/guides/introduction')).map(filename => 'introduction/' + filename.slice(0, -3)).sort()
107

118
module.exports = {
12-
title: 'Introduction', // required
9+
title: 'Introductions', // required
1310
collapsable: false,
1411
sidebarDepth: 0,
15-
children: officalPlugins
16-
// children: [
17-
// ['/api/guides/introduction/welcome', 'Welcome'],
18-
// ['/api/guides/introduction/interacting', 'Interacting with the REST API'],
19-
// ['/api/guides/introduction/callbacks', 'Callbacks'],
20-
// ['/api/guides/introduction/error-responses', 'Error Responses'],
21-
// ['/api/guides/introduction/media-type', 'Media Type'],
22-
// ['/api/guides/introduction/a-note-on-settle-api-users', 'A Note on Settle API Users'],
23-
// ['/api/guides/introduction/versioning', 'Versioning'],
24-
// ['/api/guides/introduction/resiliency', 'A resilient payment system'],
25-
// ],
12+
children: introductionDocs
2613
};
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
const {
2+
fs,
3+
path
4+
} = require('@vuepress/shared-utils')
5+
6+
const introductionQS = fs
7+
.readdirSync(path.resolve(__dirname, '../../../../api/guides/quickstarts'))
8+
.map(filename => 'quickstarts/' + filename.slice(0, -3))
9+
.sort()
10+
111
module.exports = {
212
title: 'Quickstarts', // required
313
collapsable: false,
414
sidebarDepth: 0,
5-
children: [
6-
['/api/guides/quickstarts/', 'Overview']
7-
],
15+
children: introductionQS
816
};

docs/.vuepress/nav/left/guides/tutorials.js

Lines changed: 79 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,79 @@
1+
const {
2+
fs,
3+
path
4+
} = require('@vuepress/shared-utils')
5+
const _ = require('lodash');
6+
const toTitleCase = require('to-title-case');
7+
8+
const tutorials = [];
9+
10+
const getTutorialsFolderRoot = fs.readdirSync(path.resolve(__dirname, '../../../../api/guides/tutorials'));
11+
// .map(filename => 'introduction/' + filename.slice(0, -3))
12+
// .sort()
13+
14+
_.filter(getTutorialsFolderRoot, function (levelOne) {
15+
if (levelOne !== 'index.md') {
16+
// console.log('levelOne: ', levelOne);
17+
18+
let levelOneName = levelOne.replace(/-/g, ' ');
19+
20+
levelOneName = toTitleCase(levelOneName)
21+
22+
// console.log('levelOneName: ', levelOneName);
23+
24+
const getTutorialsFolderLevelOne = fs.readdirSync(path.resolve(__dirname, '../../../../api/guides/tutorials/' + levelOne));
25+
26+
// console.log('levelTwo: ', getTutorialsFolderLevelOne);
27+
28+
let getTutorialsFolderLevelOneChildren = []
29+
30+
_.filter(getTutorialsFolderLevelOne, function (levelTwo) {
31+
32+
let levelTwoName = levelTwo.replace(/-/g, ' ');
33+
34+
levelTwoName = toTitleCase(levelTwoName)
35+
36+
let child = ['/api/guides/tutorials/' + levelOne + '/' + levelTwo + '/', levelTwoName]
37+
38+
// console.log('child: ', child);
39+
40+
getTutorialsFolderLevelOneChildren.push(child)
41+
})
42+
43+
44+
let tutorialSidebarGroup = {
45+
title: levelOneName, // required
46+
// collapsable: false,
47+
sidebarDepth: 0,
48+
children: getTutorialsFolderLevelOneChildren,
49+
// children: create_and_Send_payments,
50+
// children: [
51+
// ['/api/guides/tutorials/payments/', 'Overview'],
52+
// ['/api/guides/tutorials/payments/request', 'Request Payment'],
53+
// ['/api/guides/tutorials/payments/send', 'Send Payment'],
54+
// ],
55+
initialOpenGroupIndex: -1
56+
};
57+
58+
tutorials.push(tutorialSidebarGroup)
59+
}
60+
})
61+
62+
// console.log('tutorials: ', tutorials);
63+
64+
// console.log('create_and_Send_payments: ', create_and_Send_payments);
65+
166
function tutorial_payments() {
267
return {
368
title: 'Request and Send Payments', // required
469
// collapsable: false,
570
sidebarDepth: 0,
6-
children: [
7-
['/api/guides/tutorials/payments/', 'Overview'],
8-
['/api/guides/tutorials/payments/request', 'Request Payment'],
9-
['/api/guides/tutorials/payments/send', 'Send Payment'],
10-
],
71+
// children: create_and_Send_payments,
72+
// children: [
73+
// ['/api/guides/tutorials/payments/', 'Overview'],
74+
// ['/api/guides/tutorials/payments/request', 'Request Payment'],
75+
// ['/api/guides/tutorials/payments/send', 'Send Payment'],
76+
// ],
1177
initialOpenGroupIndex: -1
1278
};
1379
}
@@ -26,12 +92,14 @@ function tutorial_implementation_integration() {
2692
};
2793
}
2894

29-
const sidebars = [
30-
// Payments
31-
tutorial_payments(),
32-
// Implementation and Integration
33-
tutorial_implementation_integration(),
34-
]
95+
const sidebars = tutorials;
96+
97+
// const sidebars = [
98+
// // Payments
99+
// tutorial_payments(),
100+
// // Implementation and Integration
101+
// tutorial_implementation_integration(),
102+
// ]
35103

36104
module.exports = {
37105
title: 'Tutorials', // required

docs/.vuepress/nav/left/support.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
function get_sidebar_support() {
2-
return [
1+
const support = {
2+
title: 'Support', // required
3+
collapsable: false,
4+
sidebarDepth: 0,
5+
children: [
36
['/api/support/', 'How to Get Help'],
47
['https://stackoverflow.com/questions/tagged/settle-api', 'Stack Overflow'],
58
['https://stackoverflow.com/questions/tagged/settle-api', 'Issue Tracker'],
69
[
710
'https://stackoverflow.com/questions/tagged/settle-api',
8-
'Feature Request',
11+
'Feature Requests',
912
],
1013
['/api/release-notes', 'Release Notes'],
1114
['/api/terms', 'Terms of Service'],
12-
];
13-
}
15+
]
16+
};
17+
18+
module.exports = [support]

docs/.vuepress/nav/sidebars.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
const rest = require('./left/rest/rest.js');
1111
const guides = require('./left/guides.js');
12-
12+
const support = require('./left/support.js');
1313

1414

1515
const sidebar_rest = () => {
@@ -20,5 +20,10 @@ const sidebar_guides = () => {
2020
return guides;
2121
}
2222

23+
const sidebar_support = () => {
24+
return support;
25+
}
26+
2327
exports.rest = sidebar_rest;
24-
exports.guides = sidebar_guides;
28+
exports.guides = sidebar_guides;
29+
exports.support = sidebar_support;

docs/.vuepress/nav/top/mainNav.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
module.exports = [{
2-
text: 'Home',
3-
link: '/',
4-
}, {
5-
text: 'Guides',
6-
link: '/api/guides/',
7-
}, {
8-
text: 'Reference',
9-
link: '/api/reference/rest/v1/',
10-
}, {
11-
text: 'Samples',
12-
link: '/api/samples/',
13-
}, {
14-
text: 'Support',
15-
link: '/api/support/',
16-
}]
2+
text: 'Home',
3+
link: '/',
4+
},
5+
{
6+
text: 'Guides',
7+
link: '/api/guides/',
8+
},
9+
{
10+
text: 'Reference',
11+
link: '/api/reference/rest/v1/',
12+
},
13+
// {
14+
// text: 'Samples',
15+
// link: '/api/samples/',
16+
// },
17+
{
18+
text: 'Support',
19+
link: '/api/support/',
20+
}
21+
]

0 commit comments

Comments
 (0)