mirror of
https://gitea.com/gitea/docs.git
synced 2026-07-07 14:09:20 +00:00
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     Search:  Reviewed-on: https://gitea.com/gitea/gitea-docusaurus/pulls/32 Co-authored-by: HesterG <hestergong@gmail.com> Co-committed-by: HesterG <hestergong@gmail.com>
This commit is contained in:
8
src/pages/api/1.19/index.js
Normal file
8
src/pages/api/1.19/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import ClientOnly from '@site/src/components/ClientOnly';
|
||||
|
||||
export default function Api19() {
|
||||
return (
|
||||
<ClientOnly swaggerPath="/swagger-19.json"/>
|
||||
);
|
||||
}
|
||||
8
src/pages/api/1.20/index.js
Normal file
8
src/pages/api/1.20/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import ClientOnly from '@site/src/components/ClientOnly';
|
||||
|
||||
export default function Api20() {
|
||||
return (
|
||||
<ClientOnly swaggerPath="/swagger-20.json"/>
|
||||
);
|
||||
}
|
||||
8
src/pages/api/next/index.js
Normal file
8
src/pages/api/next/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import ClientOnly from '@site/src/components/ClientOnly';
|
||||
|
||||
export default function ApiLatest() {
|
||||
return (
|
||||
<ClientOnly swaggerPath="/swagger-latest.json"/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user