Commit Graph

7 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
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
nickname
fd424b0f6c fix duplicate packages and actions 2023-05-18 14:37:43 +08:00
techknowlogick
5c2862c69c Update Makefile 2023-04-30 11:02:15 +08:00
techknowlogick
46c9fae942 Update Makefile 2023-04-30 11:00:55 +08:00
Lunny Xiao
1bfd1268e7 Improve multiple languages support 2023-04-04 11:14:25 +08:00
Lunny Xiao
588e50bc79 Add makefile 2023-03-26 21:26:12 +08:00