mirror of
https://gitea.com/gitea/docs.git
synced 2026-06-26 22:26:18 +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:
12
src/components/ClientOnly.js
Normal file
12
src/components/ClientOnly.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import React from 'react';
|
||||
import ApiDoc from '@theme/ApiDoc';
|
||||
// For csr api pages
|
||||
export default function ClientOnly(props) {
|
||||
return (
|
||||
<ApiDoc
|
||||
specProps={{
|
||||
url: props.swaggerPath,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user