126 Commits

Author SHA1 Message Date
HesterG
1f003f6298 translation for blog on navbar and remove target="_blank" for internal links (#44)
- Do not use `target="_blank"`for gitea websites on navbar (same behavior as about.gitea.com)

- Translate "blog" on navbar for zh-cn

Before:

![Screen Shot 2023-07-12 at 17.40.27](/attachments/8c2d2a0d-5b66-4396-a962-9dd5aec20aaa)

After:

![Screen Shot 2023-07-12 at 17.41.47](/attachments/65822b16-9ba9-4452-94b1-f8c145ffd78b)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/44
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-07-12 12:58:44 +00:00
HesterG
2141715f56 update header to make it the same as blog (#43)
Follows https://gitea.com/gitea/blog/pulls/266, should wait for the PR because it has href points to https://blog.gitea.com

PC:

![Screen Shot 2023-07-12 at 08.53.32](/attachments/8742094d-bdca-404a-bd1f-ef34df5af328)

Mobile:

![Screen Shot 2023-07-12 at 08.53.45](/attachments/947785d6-535b-4867-91c6-1a3c465b6fdc)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/43
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-07-12 03:55:43 +00:00
HesterG
d6ee444476 Use custom api dropdown and fix compatibility for firefox (#39)
- Used custom api dropdown for changing label dynamically. Used method discussed in [this post](https://github.com/facebook/docusaurus/pull/7231). `ComponentTypes` is ejected safely.

  ![Screen Shot 2023-07-05 at 16.21.43](/attachments/b4bc8ae4-6a8a-406c-98b7-f739b13c32ba)

- Fixed dropdowns missing on chrome docs page

  ![Screen Shot 2023-07-05 at 16.44.08](/attachments/1e5315b4-a057-4325-990f-1cbc35fb475f)

-  Fixed `:has` selector compatibility problem on firefox. After (Screenshots from firefox):

  ![Screen Shot 2023-07-05 at 16.10.23](/attachments/76475fb6-fd58-42ec-b4be-6a774553a887)

  ![Screen Shot 2023-07-05 at 16.10.35](/attachments/956f623a-afdb-4ab4-8aa2-beb9420727fb)

  ![Screen Shot 2023-07-05 at 16.15.35](/attachments/af840f31-def4-4f72-8340-f29b72a748bd)

  ![Screen Shot 2023-07-05 at 16.09.30](/attachments/42fa2394-962d-4594-8ef3-c594d3c1e777)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/39
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-07-07 09:19:52 +00:00
6543
2086df848a Gitea v1.19.4 got released (#40)
Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/40
2023-07-05 17:35:59 +00:00
HesterG
04a97d20b1 Add api page (#32)
# Changes

- Added [redocusaurus](https://github.com/rohit-gohri/redocusaurus) package to display swagger api with reference to [woodpecker](https://github.com/woodpecker-ci/woodpecker/tree/master/docs)
- Change `sed` for swagger.json for proper version and baseurl.
- Add a dropdown for different api versions. (screenshot below)
- On API pages, only API version dropdown will show(hide locale dropdown, version dropdown for doc, and doc search)
- Allow build CSR API pages for development so it saves building time.

# Screenshots

![Screen Shot 2023-06-27 at 11.56.59](/attachments/7f43976d-f9f1-42ff-85f5-0bc84e549441)

![Screen Shot 2023-06-27 at 10.58.11](/attachments/bde25da5-b0a6-4908-9c69-c6aed41f8f59)

![Screen Shot 2023-06-21 at 12.26.26](/attachments/84a9bf5a-229b-4031-9654-3bae6cb3301a)

![Screen Shot 2023-06-19 at 16.34.33](/attachments/653b2b59-bc8a-4e6c-82f2-eb9710f55d8d)

Search:

![Screen Shot 2023-06-21 at 14.49.15](/attachments/3a09bd89-36a8-4156-a2df-2d3176d3ddb1)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/32
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-07-05 03:54:54 +00:00
techknowlogick
bf0608d795 1.20.0-rc2 2023-06-29 18:33:03 +00:00
techknowlogick
7ce2b24df0 Update docusaurus.config.js 2023-06-23 22:21:38 +00:00
techknowlogick
f10d6b3658 Update docusaurus.config.js 2023-06-21 05:30:02 +00:00
HesterG
7ca358b43e Add v1.20 documentation (#28)
Modified `loop_docs.sh` to take `version` and `locale` and params so do not need other `loop_docs*` scripts.

Need confirmation with version information for 1.20 and latest.
Like version in `static/20-swagger.json` and `static/latest-swagger.json`, and version used to replace `{{< version >}}`

Will wait for a stable version for 1.20

![Screen Shot 2023-06-14 at 12.12.18](/attachments/1b316978-0daf-46bb-90a7-632a0fc80898)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/28
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-06-14 07:05:13 +00:00
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
8c38ae516a Fix edit url and announcement bar color on dark mode (#20)
Changes:

1. Dark mdoe colors for announcement bar, used the way in [CSS module class names in the document](https://docusaurus.io/docs/styling-layout#global-styles) to change the style.

2. Fix edit url. Right now, clicking on "edit url" will redirect to lastest version of documents no matter from v1.19 or current version.

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/20
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-05-30 09:42:46 +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
techknowlogick
0b0b298047 Update docusaurus.config.js 2023-05-24 08:44:39 +08:00
delvh
f400873815 Improve WIP hint (#9)
Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/9
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Co-authored-by: delvh <leon@kske.dev>
Co-committed-by: delvh <leon@kske.dev>
2023-05-24 04:38:02 +08:00
HesterG
b27f00bd97 Sort usage directory by type first (#8)
1. Change name of "usage/actions", "usage/packages" to "usage/Actions" and "usage/Packages".
2. Sort usage directory by type first, so type "category" goes before "docs"

Reference from [customize-the-sidebar-items-generator](https://docusaurus.io/docs/sidebar/autogenerated#customize-the-sidebar-items-generator) and [document](https://docusaurus.io/docs/cli#docusaurus-write-translations-sitedir)

![Screen Shot 2023-05-22 at 16.22.33](/attachments/5bbc88c9-9eca-4697-84b4-b8b3c2804eb0)

Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/8
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-committed-by: HesterG <hestergong@gmail.com>
2023-05-22 16:31:34 +08:00
Lunny Xiao
dbd1986910 upgrade to 1.19.3 2023-05-08 22:32:15 +08:00
techknowlogick
ce9d97afed 1.19.2 2023-04-30 10:29:58 +08:00
Lunny Xiao
1bfd1268e7 Improve multiple languages support 2023-04-04 11:14:25 +08:00
techknowlogick
a5264ee41f Update 'docusaurus.config.js' 2023-03-25 14:04:12 +08:00
Lunny Xiao
f14bfdc5da 1.19.0 2023-03-22 16:44:38 +08:00
techknowlogick
6d3247ba3e link to gitea.com for reporting errors 2023-03-04 00:03:06 -05:00
techknowlogick
cac06e0b88 hide banner for 1.18 2023-03-03 23:57:44 -05:00
techknowlogick
078b093d51 lowercase rc 2023-03-03 23:43:02 -05:00
techknowlogick
a9b4c58a94 mark 1.19 as rc 2023-03-04 12:34:51 +08:00
techknowlogick
c0db76815d Update 'docusaurus.config.js' 2023-03-04 12:32:28 +08:00
techknowlogick
d92b99e395 first commit 2023-02-02 23:30:20 -05:00