Skip to content

Commit da3db1a

Browse files
authored
Merge pull request #1962 from loft-sh/v6-docs
WIP: DO NOT MERGE - docs v6
2 parents 2a8a3c2 + 24d2807 commit da3db1a

2,129 files changed

Lines changed: 46247 additions & 64497 deletions

File tree

Some content is hidden

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

.github/workflows/docs.yaml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"go.installDependenciesWhenBuilding": false,
66
"go.formatTool": "goimports",
77
"go.coverOnTestPackage": true,
8-
"go.useLanguageServer": true
8+
"go.useLanguageServer": true,
9+
"editor.tabSize": 2
910
}

cmd/init.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -443,15 +443,14 @@ echo 'Anyone using this project can invoke it via "devspace run migrate-db"'`,
443443

444444
// Add pipeline: dev
445445
config.Pipelines["dev"] = &latest.Pipeline{
446-
Run: `
447-
run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
448-
create_deployments --all # 2. Deploy Helm charts and manifests specfied as "deployments"
449-
start_dev ` + imageName + ` # 3. Start dev mode "` + imageName + `" (see "dev" section)`,
446+
Run: `run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
447+
create_deployments --all # 2. Deploy Helm charts and manifests specfied as "deployments"
448+
start_dev ` + imageName + ` # 3. Start dev mode "` + imageName + `" (see "dev" section)`,
450449
}
451450

452451
// Add pipeline: dev
453452
config.Pipelines["deploy"] = &latest.Pipeline{
454-
Run: `run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
453+
Run: `run_dependencies --all # 1. Deploy any projects this project needs (see "dependencies")
455454
build_images --all -t $(git describe --always) # 2. Build, tag (git commit hash) and push all images (see "images")
456455
create_deployments --all # 3. Deploy Helm charts and manifests specfied as "deployments"`,
457456
}
@@ -670,9 +669,15 @@ func (cmd *InitCmd) addDevConfig(config *latest.Config, imageName, image string,
670669
devConfig.Sync = []*latest.SyncConfig{}
671670
}
672671

673-
devConfig.Sync = append(devConfig.Sync, &latest.SyncConfig{
672+
syncConfig := &latest.SyncConfig{
674673
Path: "./",
675-
})
674+
}
675+
676+
if _, err := os.Stat(".dockerignore"); err == nil {
677+
syncConfig.UploadExcludeFile = ".dockerignore"
678+
}
679+
680+
devConfig.Sync = append(devConfig.Sync, syncConfig)
676681

677682
devConfig.Terminal = &latest.Terminal{
678683
Command: "./" + startScriptName,

docs/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16.7

docs/README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,43 @@ This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern
77
### Installation
88

99
```
10-
$ yarn
10+
yarn
1111
```
1212

13-
### Local Development
14-
13+
### Development
1514
```
16-
$ yarn start
15+
yarn start
1716
```
18-
1917
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
2018

21-
### Build
22-
19+
### Production Build
2320
```
24-
$ yarn build
21+
yarn build
2522
```
26-
2723
This command generates static content into the `build` directory and can be served using any static contents hosting service.
2824

29-
### Deployment
30-
25+
### Create New Major Version
26+
```bash
27+
yarn run docusaurus docs:version 5.x
3128
```
32-
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
29+
30+
### Generate CLI Reference
31+
```bash
32+
cd ../ # main project directory
33+
go run ./docs/hack/cli/main.go
3334
```
3435

35-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
36+
### Generate Partials For Config (devspace.yaml)
37+
```bash
38+
cd ../ # main project directory
3639

40+
go run ./docs/hack/config/partials/main.go
41+
```
3742

38-
## Creating New Versions
3943

40-
### 1. Generate Command Docs
44+
### Generate Schema For Config (devspace.yaml)
4145
```bash
4246
cd ../ # main project directory
43-
go run -mod=vendor ./hack/gen-docs.go
44-
```
4547

46-
### 2. Create Version
47-
```bash
48-
yarn run docusaurus docs:version 5.18
48+
go run ./docs/hack/config/schemas/main.go
4949
```

docs/docusaurus.config.js

Lines changed: 104 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
__webpack_public_path__ = "/cli/"
1+
__webpack_public_path__ = "/docs/"
22

3-
const versions = require('./versions.json');
3+
const resolveGlob = require('resolve-glob');
44

55
module.exports = {
6-
title: 'DevSpace CLI | Documentation',
6+
title: 'DevSpace | Documentation',
77
tagline: 'The tagline of my site',
88
url: 'https://devspace.sh',
99
baseUrl: __webpack_public_path__,
@@ -15,60 +15,55 @@ module.exports = {
1515
disableSwitch: true
1616
},
1717
navbar: {
18+
//hideOnScroll: true,
1819
logo: {
1920
alt: 'DevSpace',
20-
src: '/img/logo-devspace.svg',
21+
src: '/media/logos/devspace-logo-primary.svg',
2122
href: 'https://devspace.sh/',
2223
target: '_self'
2324
},
2425
items: [
2526
{
26-
to: 'versions',
27-
label: `${versions[0]}`,
28-
position: 'left',
29-
className: 'version-link'
27+
type: 'docsVersionDropdown',
28+
position: 'left',
3029
},
3130
{
32-
href: 'https://devspace.sh/',
33-
label: 'Website',
34-
position: 'left',
35-
target: '_self'
31+
href: 'https://devspace.sh/',
32+
label: 'Website',
33+
position: 'left',
34+
target: '_self'
3635
},
3736
{
38-
href: __webpack_public_path__ + 'docs/' + (process.env.NODE_ENV == 'production' ? '' : 'next/') + 'introduction',
39-
label: 'Docs',
40-
position: 'left',
41-
target: '_self'
37+
href: 'https://loft.sh/blog/tags/devspace',
38+
label: 'Blog',
39+
position: 'left',
40+
target: '_self'
4241
},
4342
{
44-
href: 'https://devspace.cloud/blog',
45-
label: 'Blog',
46-
position: 'left'
43+
href: 'https://slack.loft.sh/',
44+
className: 'slack-link',
45+
'aria-label': 'Slack',
46+
position: 'right',
4747
},
4848
{
49-
href: 'https://slack.k8s.io/#devspace',
50-
className: 'slack-link',
51-
'aria-label': 'Slack',
52-
position: 'right',
53-
},
54-
{
55-
href: 'https://github.com/loft-sh/devspace',
56-
className: 'github-link',
57-
'aria-label': 'GitHub',
58-
position: 'right',
49+
href: 'https://github.com/loft-sh/devspace',
50+
className: 'github-link',
51+
'aria-label': 'GitHub',
52+
position: 'right',
5953
},
6054
],
6155
},
6256
algolia: {
63-
apiKey: "b9533b52dde7e23272dbd4211435c070",
57+
apiKey: "9396b07e4ad34e90394fbfe79695d88d",
58+
appId: "L1ZH1CZBMP",
6459
indexName: "devspace-cli",
6560
placeholder: "Search...",
6661
algoliaOptions: {},
6762
},
6863
footer: {
6964
style: 'light',
7065
links: [],
71-
copyright: `Copyright © ${new Date().getFullYear()} DevSpace Authors`,
66+
copyright: `Copyright © DevSpace Authors <br/>DevSpace is an open-source project originally created by <a href="https://loft.sh/">Loft Labs, Inc.</a>`,
7267
},
7368
},
7469
presets: [
@@ -77,27 +72,92 @@ module.exports = {
7772
{
7873
docs: {
7974
path: 'pages',
80-
routeBasePath: 'docs',
75+
routeBasePath: '/',
8176
sidebarPath: require.resolve('./sidebars.js'),
82-
editUrl:
83-
'https://github.com/loft-sh/devspace/edit/master/docs/',
84-
},
77+
showLastUpdateTime: true,
78+
editUrl: 'https://github.com/loft-sh/devspace/edit/master/docs/',
79+
lastVersion: "current",
80+
versions: {
81+
current: {
82+
label: "6.x (Latest)",
83+
path: ""
84+
}
85+
},
86+
remarkPlugins: [
87+
[
88+
require('mdx-mermaid'),
89+
{
90+
mermaid: {
91+
securityLevel: "loose",
92+
theme: 'neutral',
93+
themeVariables: {
94+
primaryColor: '#00bdff',
95+
lineColor: '#bdd6f3',
96+
arrowheadColor: '#bdd6f3',
97+
mainBkg: '#6c89ad',
98+
contrast: '#3e5371',
99+
textColor: '#fff',
100+
primaryTextColor: '#fff',
101+
secondaryTextColor: '#fff',
102+
tertiaryTextColor: '#fff',
103+
border1: 'transparent',
104+
border2: 'transparent',
105+
clusterBkg: 'transparent',
106+
clusterBorder: '#bdd6f3',
107+
edgeLabelBackground: '#bcd6f3',
108+
109+
},
110+
flowchart: {
111+
curve: 'basis',
112+
nodeSpacing: 20,
113+
rankSpacing: 50,
114+
}
115+
}
116+
}
117+
]
118+
],
119+
},
85120
theme: {
86-
customCss: require.resolve('./src/css/custom.css'),
121+
customCss: resolveGlob.sync(['./src/css/**/*.scss']),
87122
},
88123
},
89124
],
125+
[
126+
'redocusaurus',
127+
{
128+
specs: [
129+
{
130+
spec: 'schemas/config-openapi.json',
131+
},
132+
],
133+
theme: {
134+
primaryColor: '#00bdff',
135+
redocOptions: {
136+
hideDownloadButton: false,
137+
disableSearch: true,
138+
colors: {
139+
border: {
140+
dark: '#00bdff',
141+
light: '#00bdff',
142+
}
143+
}
144+
},
145+
},
146+
},
147+
],
148+
],
149+
themes: [
150+
'@saucelabs/theme-github-codeblock'
151+
],
152+
plugins: [
153+
'docusaurus-plugin-sass',
154+
'plugin-image-zoom',
90155
],
91156
scripts: [
92157
{
93-
src:
94-
'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
95-
async: true,
96-
},
97-
{
98-
src:
99-
'https://devspace.sh/docs.js',
100-
async: true,
158+
src: 'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
159+
async: true,
101160
},
102161
],
162+
clientModules: resolveGlob.sync(['./src/js/**/*.js']),
103163
};

0 commit comments

Comments
 (0)