Skip to content

Commit ae97c38

Browse files
denis-alkhelalictauchenalexeymagdich-tigera
authored
[DOCS-846] Multi-Instance and Versioning (#65)
* Added new docs directories to gitignore * Changes to package.json and docusaur\us.config.js * Adds sidebars navigation for the three products * Fix imports * Fix variable substitution * [DOCS-846] Don't use calico as default instance * [DOCS-846] Add variables versioning * [DOCS-846] Add components versioning * [DOCS-846] Refactoring * Fixes navigation config and some links Co-authored-by: Christopher Tauchen <[email protected]> Co-authored-by: Alexey Magdich <[email protected]>
1 parent c66411c commit ae97c38

Some content is hidden

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

45 files changed

+2011
-6802
lines changed

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,22 @@ yarn-error.log*
3030
/docs/calico/
3131
/docs/calico-enterprise/
3232
/docs/calico-cloud/
33+
/calico/
34+
/calico-enterprise/
35+
/calico-cloud/
3336
/src/data/
3437
/static/img/calico/
3538
/static/img/calico-enterprise/
3639
/static/img/calico-cloud/
3740
/static/css/swagger-ui/swagger-ui-custom.css
3841
/static/json/calico-api-swagger.json
42+
# versions related
43+
# /calico_versioned_docs/
44+
# /calico-cloud_versioned_docs/
45+
# /calico-enterprise_versioned_docs/
46+
calico_versions.json
47+
calico-cloud_versions.json
48+
calico-enterprise_versions.json
49+
/calico_versioned_sidebars/
50+
/calico-cloud_versioned_sidebars/
51+
/calico-enterprise_versioned_sidebars/

calico-cloud_versioned_docs/.gitkeep

Whitespace-only changes.

calico-enterprise_versioned_docs/.gitkeep

Whitespace-only changes.

calico_versioned_docs/.gitkeep

Whitespace-only changes.

default/index.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Don't delete this file, it requires for "default" instance
2+
https://docusaurus.io/docs/docs-multi-instance

docusaurus.config.js

+53-7
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ const config = {
3333
'classic',
3434
/** @type {import('@docusaurus/preset-classic').Options} */
3535
({
36+
// TODO: try to find a way to not specify a default instance
3637
docs: {
37-
sidebarPath: require.resolve('./sidebars.js'),
38-
editUrl: 'https://github.com/tigera/docs/',
39-
beforeDefaultRemarkPlugins: [variablesPlugin, componentImagePlugin],
38+
path: 'default',
39+
sidebarPath: false,
4040
},
4141
blog: false,
4242
theme: {
@@ -71,20 +71,28 @@ const config = {
7171
label: 'Calico',
7272
type: 'docSidebar',
7373
sidebarId: 'calicoSidebar',
74+
docsPluginId: 'calico',
7475
position: 'left',
7576
},
7677
{
7778
label: 'Calico Enterprise',
7879
type: 'docSidebar',
7980
sidebarId: 'calicoEnterpriseSidebar',
81+
docsPluginId: 'calico-enterprise',
8082
position: 'left',
8183
},
8284
{
8385
label: 'Calico Cloud',
8486
type: 'docSidebar',
8587
sidebarId: 'calicoCloudSidebar',
88+
docsPluginId: 'calico-cloud',
8689
position: 'left',
8790
},
91+
{
92+
type: 'docsVersionDropdown',
93+
position: 'right',
94+
docsPluginId: 'calico',
95+
},
8896
{
8997
label: 'Tigera',
9098
href: 'https://tigera.io',
@@ -110,15 +118,15 @@ const config = {
110118
items: [
111119
{
112120
label: 'Calico',
113-
to: '/docs/calico/about/about-calico',
121+
to: '/calico/category/calico',
114122
},
115123
{
116124
label: 'Calico Enterprise',
117-
to: '/docs/calico-enterprise/about-calico-enterprise',
125+
to: '/calico-enterprise/category/calico-enterprise',
118126
},
119127
{
120128
label: 'Calico Cloud',
121-
to: '/docs/calico-cloud',
129+
to: '/calico-cloud',
122130
},
123131
],
124132
},
@@ -168,7 +176,45 @@ const config = {
168176
darkTheme: darkCodeTheme,
169177
},
170178
}),
171-
plugins: ['docusaurus-plugin-sass'],
179+
plugins: [
180+
'docusaurus-plugin-sass',
181+
[
182+
'@docusaurus/plugin-content-docs',
183+
/** @type {import('@docusaurus/plugin-content-docs').Options} */
184+
{
185+
id: 'calico',
186+
path: 'calico',
187+
routeBasePath: 'calico',
188+
editCurrentVersion: true,
189+
sidebarPath: require.resolve('./sidebars-calico.js'),
190+
beforeDefaultRemarkPlugins: [variablesPlugin, componentImagePlugin],
191+
},
192+
],
193+
[
194+
'@docusaurus/plugin-content-docs',
195+
/** @type {import('@docusaurus/plugin-content-docs').Options} */
196+
{
197+
id: 'calico-enterprise',
198+
path: 'calico-enterprise',
199+
routeBasePath: 'calico-enterprise',
200+
editCurrentVersion: true,
201+
sidebarPath: require.resolve('./sidebars-calico-enterprise.js'),
202+
beforeDefaultRemarkPlugins: [variablesPlugin, componentImagePlugin],
203+
},
204+
],
205+
[
206+
'@docusaurus/plugin-content-docs',
207+
/** @type {import('@docusaurus/plugin-content-docs').Options} */
208+
{
209+
id: 'calico-cloud',
210+
path: 'calico-cloud',
211+
routeBasePath: 'calico-cloud',
212+
editCurrentVersion: true,
213+
sidebarPath: require.resolve('./sidebars-calico-cloud.js'),
214+
beforeDefaultRemarkPlugins: [variablesPlugin, componentImagePlugin],
215+
},
216+
],
217+
],
172218
};
173219

174220
module.exports = config;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"write-heading-ids": "docusaurus write-heading-ids",
1515
"test": "jest --passWithNoTests",
1616
"git-clean": "git restore --staged . && git clean -f .",
17-
"dir-clean": "rm -rf ./docs/calico ./docs/calico-enterprise ./docs/calico-cloud ./src/data ./static/img/calico ./static/img/calico-enterprise ./static/img/calico-cloud ./static/css/swagger-ui/swagger-ui-custom.css ./static/json/calico-api-swagger.json"
17+
"dir-clean": "rm -rf ./calico ./calico-enterprise ./calico-cloud ./docs/calico ./docs/calico-enterprise ./docs/calico-cloud ./src/data ./static/img/calico ./static/img/calico-enterprise ./static/img/calico-cloud ./static/css/swagger-ui/swagger-ui-custom.css ./static/json/calico-api-swagger.json"
1818
},
1919
"dependencies": {
2020
"@docusaurus/core": "^2.1.0",

sidebars-calico-cloud.js

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
// This is the navigation file for Calico Cloud
2+
3+
module.exports = {
4+
calicoCloudSidebar: [
5+
'index',
6+
{
7+
type: 'category',
8+
label: 'Install and upgrade',
9+
link: {
10+
type: 'generated-index',
11+
title: 'Install and upgrade',
12+
/*description: '', */
13+
slug: 'get-started',
14+
},
15+
items: [
16+
{
17+
type: 'autogenerated',
18+
dirName: 'get-started'
19+
}
20+
],
21+
},
22+
{
23+
type: 'category',
24+
label: 'Tutorials',
25+
link: {
26+
type: 'generated-index',
27+
title: 'Tutorials',
28+
/*description: '', */
29+
slug: 'get-started/tutorials',
30+
},
31+
items: [
32+
{
33+
type: 'autogenerated',
34+
dirName: 'get-started/tutorials',
35+
},
36+
],
37+
},
38+
{
39+
type: 'category',
40+
label: 'Workload access controls',
41+
link: {
42+
type: 'generated-index',
43+
title: 'Workload access controls',
44+
/*description: '', */
45+
slug: 'workload-access',
46+
},
47+
items: [
48+
{
49+
type: 'autogenerated',
50+
dirName: 'workload-access',
51+
},
52+
{
53+
type: 'autogenerated',
54+
dirName: 'security',
55+
},
56+
],
57+
},
58+
{
59+
type: 'category',
60+
label: 'Observability and troubleshooting',
61+
link: {
62+
type: 'generated-index',
63+
title: 'Observability and troubleshooting',
64+
/*description: '', */
65+
slug: 'visibility',
66+
},
67+
items: [
68+
{
69+
type: 'autogenerated',
70+
dirName: 'visibility',
71+
},
72+
],
73+
},
74+
{
75+
type: 'category',
76+
label: 'Threat',
77+
link: {
78+
type: 'generated-index',
79+
title: 'Threat',
80+
/*description: '', */
81+
slug: 'threat',
82+
},
83+
items: [
84+
{
85+
type: 'autogenerated',
86+
dirName: 'threat',
87+
},
88+
],
89+
},
90+
{
91+
type: 'category',
92+
label: 'Image assurance',
93+
link: {
94+
type: 'generated-index',
95+
title: 'Image assurance',
96+
/*description: '', */
97+
slug: 'image-assurance',
98+
},
99+
items: [
100+
{
101+
type: 'autogenerated',
102+
dirName: 'image-assurance',
103+
},
104+
],
105+
},
106+
{
107+
type: 'category',
108+
label: 'Compliance and security',
109+
link: {
110+
type: 'generated-index',
111+
title: 'Compliance and security',
112+
/*description: '', */
113+
slug: 'compliance',
114+
},
115+
items: [
116+
{
117+
type: 'autogenerated',
118+
dirName: 'compliance',
119+
},
120+
],
121+
},
122+
{
123+
type: 'category',
124+
label: 'Networking',
125+
link: {
126+
type: 'generated-index',
127+
title: 'Networking',
128+
/*description: '', */
129+
slug: 'networking',
130+
},
131+
items: [
132+
{
133+
type: 'autogenerated',
134+
dirName: 'networking',
135+
},
136+
],
137+
},
138+
{
139+
type: 'category',
140+
label: 'User and cluster management',
141+
link: {
142+
type: 'generated-index',
143+
title: 'User and cluster management',
144+
/*description: '', */
145+
slug: 'operations',
146+
},
147+
items: [
148+
{
149+
type: 'autogenerated',
150+
dirName: 'operations',
151+
},
152+
],
153+
},
154+
{
155+
type: 'category',
156+
label: 'Reference',
157+
link: {
158+
type: 'generated-index',
159+
title: 'Reference',
160+
/*description: '', */
161+
slug: 'reference',
162+
},
163+
items: [
164+
{
165+
type: 'autogenerated',
166+
dirName: 'reference',
167+
},
168+
],
169+
},
170+
{
171+
type: 'category',
172+
label: 'Get help',
173+
link: {
174+
type: 'generated-index',
175+
title: 'Get help',
176+
/*description: '', */
177+
slug: 'get-help',
178+
},
179+
items: [
180+
{
181+
type: 'autogenerated',
182+
dirName: 'get-help',
183+
},
184+
],
185+
},
186+
'release-notes/index',
187+
],
188+
};

0 commit comments

Comments
 (0)