Commit Graph

29 Commits

Author SHA1 Message Date
HesterG
1ba3ac7c99 Add outdated component to outdated documents (#25)
- `git log` needs all commit history to compare latest commit of files, so changed `git clone --depth=1` to `git clone`. This will make the step take longer, so might be improved if there is a better way.

- `src/theme/MDXContent/index.js` is from [ejecting of the component](https://docusaurus.io/docs/swizzling#ejecting) inside `@docusaurus/theme-classic` plugin, and this one is safe to eject according to docusaurus

    ![Screen Shot 2023-06-06 at 12.12.28](/attachments/17a3a84b-cec0-4849-8bd6-9e0471d9536f)

    ![Screen Shot 2023-06-06 at 12.12.15](/attachments/58bba321-3cfb-4a8b-8aeb-84422a06c472)

- [Outdated component style reference](https://mui.com/material-ui/react-alert/)

- Added [`Translate` component](https://docusaurus.io/docs/next/docusaurus-core#translate) to `Outdated` so it can be localized. [reference](https://docusaurus.io/docs/next/i18n/tutorial#translate-your-react-code)

- One way to check for the specific outdated documents:

    search for `lastest commit timestamp` in [prepare nightly docs and prepare 1.19 docs steps](https://gitea.com/gitea/gitea-docusaurus/actions/runs/74)

# After

The Chinese documents that are outdated (latest commit is ealier than laster commit of English version):

![Screen Shot 2023-06-06 at 13.04.24](/attachments/e5d16267-d8d8-434e-89b1-138d04ec92a3)

![Screen Shot 2023-06-06 at 13.05.07](/attachments/af8f996a-5318-4f89-841f-b27a4903a27d)

![Screen Shot 2023-06-06 at 13.05.14](/attachments/e6aba31b-46ba-4a32-ad81-81007e0f711e)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/25
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-06-08 03:34:23 +00:00
jolheiser
d3323cee1c fix: sed incantation for dl.gitea.com main-nightly (#26)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/26
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-committed-by: jolheiser <john.olheiser@gmail.com>
2023-06-06 20:31:45 +00:00
HesterG
817dac0942 Sed for versions information (#24)
Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/24
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-05-31 05:05:50 +00:00
jolheiser
54ed2879c1 Fix sed incantation for empty (#23)
Follow up for #22

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/23
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-committed-by: jolheiser <john.olheiser@gmail.com>
2023-05-30 19:10:17 +00:00
jolheiser
d3c11f4363 fix: update sed incantation for empty (#22)
Should resolve #21

I cannot seem to get this to run properly on my machine, however this is an educated guess because the Chinese translation looks correct.

zh-cn
https://docs.gitea.com/zh-cn/administration/config-cheat-sheet#repository---release-repositoryrelease
8c38ae516a/loop_docs-zh-cn.sh (L11)

en-us
https://docs.gitea.com/administration/config-cheat-sheet#repository---release-repositoryrelease
(check diff for current incantation)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/22
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-committed-by: jolheiser <john.olheiser@gmail.com>
2023-05-30 17:51:06 +00:00
HesterG
5c13cb18d2 Fix relrefs by following formats allowed by docusaurus (#18)
relrefs from upstream is in the format of `[text]({{< relref "doc/<path under doc>.md" >}})`, for example, `[instructions]({{< relref "doc/installation/from-source.en-us.md" >}})`. In this PR, use bash scripts to remove `{{< relref "doc/`,  `.en-us`/`.zh-cn` and `" >}}` parts so the link can be used by [docusaurus](https://docusaurus.io/docs/markdown-features/links)

Related: https://github.com/go-gitea/gitea/pull/24979, might need to backport this PR into 1.19
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/18
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-05-29 16:24:40 +00:00
HesterG
c911962cd6 fix typo and some seds for <empty> (#15)
# Before:

![Screen Shot 2023-05-26 at 15.48.12](/attachments/09d9a965-1587-40c9-b81b-e8416ac0c226)![Screen Shot 2023-05-26 at 15.48.17](/attachments/8beda8a1-5c49-4c87-95e7-e4aa95e56ec9)![Screen Shot 2023-05-26 at 15.48.57](/attachments/21dad81e-eed1-4280-bbb4-eeda039bec41)![Screen Shot 2023-05-26 at 16.14.44](/attachments/07a3148a-52ea-43bb-8e07-c0d8f31d1c24)

# After:

![Screen Shot 2023-05-26 at 16.02.38](/attachments/24239f32-6e9a-487c-8532-b6bd22ca6a50)(/attachments/85c184f3-58ca-4616-bb9d-9afacbc59290)![Screen Shot 2023-05-26 at 16.03.02](/attachments/4952880a-3254-4139-8943-ff37a9797bd7)![Screen Shot 2023-05-26 at 16.05.03](/attachments/ef77be92-2c60-4962-8b0a-efeed63a663b)![Screen Shot 2023-05-26 at 16.15.22](/attachments/22ea1d0b-2838-488d-92c7-e2db8e53ebae)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/15
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-05-26 17:49:55 +08:00
HesterG
20c970682b Add Chinese support (#13)
# Main changes and Some notices

- Chines Docs should be put into corresponding versions' folders under `i18n/zh-cn/docusaurus-plugin-content-docs`. See [translate-markdown-files](https://docusaurus.io/docs/i18n/tutorial#translate-markdown-files) for reference. And also [srs-docs](https://github.com/ossrs/srs-docs) is a project that can be used as a reference. So changed the related paths in `loop_docs*` scripts.

- The markdown files under `docs/<version>` and `i18n/zh-cn/docusaurus-plugin-content-docs/<version>` must have the same name to be referred as translated. Files inside docs are corresponding to `current` version.
For example, `docs/administration/mail-templates.md` and `i18n/zh-cn/docusaurus-plugin-content-docs/current/administration/mail-templates.md`.  Filename of `mail-templates.md` must be the same (cannot be `mail-templates.zh-cn.md` and `mail-templates.us-en.md`)
So trim the `.en-us.md` and `.zh-cn.md` to `.md` to ensure the same names inside `loop_docs*` scripts.

- Used `npx docusaurus write-translations --locale zh-cn` to do sidebar, footer, and header translations, so no need to keep `sideBarCN` anymore. [reference](https://docusaurus.io/docs/cli#docusaurus-write-translations-sitedir)

- Local Tests for `en` and `zh-cn` are separeted, run the following on local respectly to test them

    ```bash
    # test en version
    npm run start
    # test zh-cn version
    npm run start -- --locale zh-cn
    ```

- If wants to test `en` and `zh-cn` both at the same time, run build and serve

    ```
    npm run build
    npm run serve
    ```

- Added some indexed page, for example:

![Screen Shot 2023-05-26 at 13.49.34](/attachments/9eeb3d38-c309-457d-9015-053b9c5ca8d6)

![Screen Shot 2023-05-26 at 13.49.49](/attachments/fc348d17-ce4c-4c4d-9240-b69add4ef06e)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/13
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-05-26 14:30:13 +08:00
techknowlogick
511a7f80ff main-nightly is version name for nightly version 2023-05-25 03:20:08 +08:00
nickname
45c9538894 add back titles to usage 2023-05-19 09:52:59 +08:00
Lunny Xiao
dbd1986910 upgrade to 1.19.3 2023-05-08 22:32:15 +08:00
techknowlogick
25c59c13e6 Update loop_docs.sh 2023-04-30 10:59:00 +08:00
techknowlogick
d937b296e8 1.19.2 2023-04-30 10:30:42 +08:00
Lunny Xiao
da0e55515b Fix multiple languages sidebar 2023-04-04 12:14:20 +08:00
techknowlogick
68d86d58d3 full path to setup-node 2023-03-26 01:41:49 -04:00
techknowlogick
cb5e8a8761 cross platform sed 2023-03-26 01:22:34 -04:00
techknowlogick
b48ab0a829 revert: that didn't work 2023-03-26 00:57:39 -04:00
techknowlogick
d917889b2e remove extra / 2023-03-26 00:52:25 -04:00
techknowlogick
f058a3c00a test without hardcoded slugs 2023-03-26 00:26:13 -04:00
Lunny Xiao
e9efa41ba0 try to fix siderbar position 2023-03-25 22:04:50 +08:00
Lunny Xiao
1116d1e72d Update structures for 1.19 and current version 2023-03-24 13:10:55 +08:00
techknowlogick
31f11f2aaf clean docs 2023-03-03 23:25:40 -05:00
techknowlogick
b72d563f86 Update 'loop_docs.sh' 2023-02-23 16:45:52 +08:00
techknowlogick
12185d6bd1 use correct version 2023-02-23 00:51:33 -05:00
techknowlogick
8ef5860e78 Merge branch 'main' of gitea.com:gitea/gitea-docusaurus 2023-02-23 00:49:35 -05:00
techknowlogick
130857ef1e add 1.19 docs 2023-02-23 00:47:02 -05:00
techknowlogick
886d941873 Update 'loop_docs.sh' 2023-02-23 13:24:02 +08:00
techknowlogick
4263d7de17 Update 'loop_docs.sh' 2023-02-22 02:29:02 +08:00
techknowlogick
d92b99e395 first commit 2023-02-02 23:30:20 -05:00