Skip to content

Commit

Permalink
Change the default release version for SRS documentation to 5.0. (#56)
Browse files Browse the repository at this point in the history
* frozen 5.0, add 6.0

* update README.md

* change last version to 5.0

* set defaultVersion to 5.0

* Switch to 5.0

---------

Co-authored-by: panda <[email protected]>
Co-authored-by: winlin <[email protected]>
  • Loading branch information
3 people authored Jul 20, 2023
1 parent 722ab65 commit b9e3605
Show file tree
Hide file tree
Showing 180 changed files with 27,237 additions and 16 deletions.
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ The links in docs, relative link, for example:
The links in blog or pages, absolute url link, for example:

```markdown
[Wiki: Getting Started](/docs/v4/doc/getting-started)
[Developer Documentation](/docs/v4/doc/getting-started)
[Wiki: Getting Started](/docs/v5/doc/getting-started)
[Developer Documentation](/docs/v5/doc/getting-started)
```

> Note: Please follow this rule, otherwise, the link from searching will fail.
Expand Down Expand Up @@ -287,3 +287,55 @@ yarn run docusaurus docs:version 4.2.0
remarkPlugins: [require('mdx-mermaid')],
},
```

4. how to upgrade version
> forzen current version to 5.0, set current version ref to 6.0, do the following steps:
* run the cmd `yarn docusaurus docs:version 5.0`
* it will auto modify ./versions.json to add 5.0:
```
[
"5.0",
"4.0"
]
```
* auto generate en-us version-5.0 dir, and version-5.0-sidebars.json
* prepare zh-cn 5.0
* `cd i18n/zh-cn && cp -af current version-5.0`
* `cd i18n/zh-cn && cp current.json version-5.0.json`
* update docusaurus.config.js
* after upgrade, the dir displayed like:

```diff
+├── docusaurus.config.js
├── i18n
│   ├── en-us
│   │   ├── code.json
│   │   ├── docusaurus-plugin-content-docs
│   │   │   ├── current
│   │   │   └── current.json
│   └── zh-cn
│   ├── code.json
│   ├── docusaurus-plugin-content-docs
│   │   ├── current
│   │   ├── current.json
│   │   ├── version-4.0
│   │   ├── version-4.0.json
+│   │   ├── version-5.0
+│   │   └── version-5.0.json
├── sidebars.json
├── versioned_docs
│   ├── version-4.0
│   │   ├── doc
│   │   ├── tools
│   │   └── tutorial
+│   └── version-5.0
│   ├── doc
│   ├── tools
│   └── tutorial
├── versioned_sidebars
│   ├── version-4.0-sidebars.json
+│   └── version-5.0-sidebars.json
+├── versions.json
├── versionsArchived.json
```
10 changes: 6 additions & 4 deletions auto/pub.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

REALPATH=$(realpath $0)
WORK_DIR=$(cd $(dirname $REALPATH)/.. && pwd)
echo "Run pub at $WORK_DIR from $0"
cd $WORK_DIR
# Execute by: bash xxx.sh or bash zzz/yyy/xxx.sh or ./xxx.sh or ./zzz/yyy/xxx.sh source xxx.sh
REALPATH=$(realpath ${BASH_SOURCE[0]})
SCRIPT_DIR=$(cd $(dirname ${REALPATH}) && pwd)
WORK_DIR=$(cd $(dirname ${REALPATH})/.. && pwd)
echo "BASH_SOURCE=${BASH_SOURCE}, REALPATH=${REALPATH}, SCRIPT_DIR=${SCRIPT_DIR}, WORK_DIR=${WORK_DIR}"
cd ${WORK_DIR}

git st |grep -q 'nothing to commit'
if [[ $? -ne 0 ]]; then
Expand Down
11 changes: 8 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ const config = {
: `https://github.com/ossrs/srs-docs/edit/main/i18n/${locale}/docusaurus-plugin-content-docs/version-${version}/${docPath}`;
}
},
// lastVersion: 'current',
lastVersion: versions[0],
//lastVersion: versions[0],
versions: {
current: {
label: `5.0 🚧`,
label: `6.0 🚧`,
path: 'v6',
},
'5.0': {
label: '5.0',
path: 'v5',
},
'4.0': {
Expand Down Expand Up @@ -204,7 +208,7 @@ const config = {
},
{
label: 'Docs',
to: '/docs/v4/doc/getting-started',
to: '/docs/v5/doc/getting-started',
},
{
to: '/blog',
Expand Down Expand Up @@ -262,6 +266,7 @@ const config = {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
defaultVersion: '5.0'
}),
i18n: {
defaultLocale: defaultLocale,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The qualification tasks are usually shown in the project description. Contact th

If you are selected for a particular project then you are not only expected to present a working implementation but you should also submit your work for inclusion for the SRS codebase. This should be done at least 2-3 weeks before the end of the second work period by sending patches to the [SRS Bug Issue](https://github.com/ossrs/srs)&[Discord](https://discord.gg/DfJFjpxmC7) where the SRS community and your mentor will review your work. You will likely be asked to make some changes and resend improved versions. If you feel that no consensus is reached about how something should be done then follow the advice of your mentor.

In order to create good quality patches make sure to read the [Developer Documentation](/docs/v4/doc/getting-started).
In order to create good quality patches make sure to read the [Developer Documentation](/docs/v5/doc/getting-started).

### Contacting SRS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The qualification tasks are usually shown in the project description. Contact th

If you are selected for a particular project then you are not only expected to present a working implementation but you should also submit your work for inclusion for the SRS codebase. This should be done at least 2-3 weeks before the end of the second work period by sending patches to the [SRS Bug Issue](https://github.com/ossrs/srs)&[Discord](https://discord.gg/DfJFjpxmC7) where the SRS community and your mentor will review your work. You will likely be asked to make some changes and resend improved versions. If you feel that no consensus is reached about how something should be done then follow the advice of your mentor.

In order to create good quality patches make sure to read the [Developer Documentation](/docs/v4/doc/getting-started).
In order to create good quality patches make sure to read the [Developer Documentation](/docs/v5/doc/getting-started).

### Contacting SRS

Expand Down
26 changes: 26 additions & 0 deletions i18n/zh-cn/docusaurus-plugin-content-docs/version-5.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"sidebar.docsSidebar.category.Getting Started": {
"message": "起步"
},
"sidebar.docsSidebar.category.Main Protocols": {
"message": "核心协议"
},
"sidebar.docsSidebar.category.Main Features": {
"message": "核心功能"
},
"sidebar.docsSidebar.category.OpenAPI": {
"message": "开放接口"
},
"sidebar.docsSidebar.category.Clusters": {
"message": "集群"
},
"sidebar.docsSidebar.category.DevOps": {
"message": "运维"
},
"sidebar.docsSidebar.category.Advanced Guides": {
"message": "高级指引"
},
"sidebar.docsSidebar.category.Others": {
"message": "其他"
}
}
Loading

0 comments on commit b9e3605

Please sign in to comment.