mirror of
https://github.com/torrentpier/torrentpier
synced 2025-07-05 12:36:12 -07:00
refactor: streamline Docusaurus configuration and enhance sidebar structure
- Removed the API sidebar from docusaurus.config.ts and updated the main documentation sidebar to manually include relevant categories, excluding the API. - Cleared out unused plugin configurations to simplify the setup. - Adjusted sidebar.ts to reflect the new structure, ensuring better organization of documentation categories. - Updated API documentation files to improve code formatting and consistency in response examples. These changes aim to enhance the clarity and accessibility of the documentation, providing a more user-friendly experience.
This commit is contained in:
parent
ae46c4d69f
commit
6651c06fd6
7 changed files with 67 additions and 36 deletions
|
@ -9,6 +9,8 @@ tags: [announcement, laravel, development]
|
|||
|
||||
We're excited to announce the complete rewrite of TorrentPier using modern web technologies. This blog will document our journey, share development updates, and provide insights into the decisions we make along the way.
|
||||
|
||||
<!-- truncate -->
|
||||
|
||||
## Why a Rewrite?
|
||||
|
||||
The original TorrentPier v2.x served the community well for many years, but technology has evolved significantly. We decided it was time for a complete modernization to:
|
||||
|
|
|
@ -9,7 +9,7 @@ The Emoji Aliases API allows you to manage alternative shortcodes for emojis, en
|
|||
|
||||
## Base URL
|
||||
|
||||
```
|
||||
```http
|
||||
/api/emoji/aliases
|
||||
```
|
||||
|
||||
|
@ -357,7 +357,7 @@ curl -X DELETE "https://api.example.com/api/emoji/aliases/3" \
|
|||
|
||||
#### Example Response
|
||||
|
||||
```
|
||||
```text
|
||||
HTTP/1.1 204 No Content
|
||||
```
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ The Emoji Categories API allows you to manage emoji categories used to organize
|
|||
|
||||
## Base URL
|
||||
|
||||
```
|
||||
```http
|
||||
/api/emoji/categories
|
||||
```
|
||||
|
||||
|
@ -248,7 +248,7 @@ curl -X DELETE "https://api.example.com/api/emoji/categories/3" \
|
|||
|
||||
#### Example Response
|
||||
|
||||
```
|
||||
```text
|
||||
HTTP/1.1 204 No Content
|
||||
```
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ The Emoji API allows you to manage individual emojis, including Unicode emojis,
|
|||
|
||||
## Base URL
|
||||
|
||||
```
|
||||
```http
|
||||
/api/emoji/emojis
|
||||
```
|
||||
|
||||
|
@ -237,6 +237,7 @@ POST /api/emoji/emojis
|
|||
#### Example Requests
|
||||
|
||||
**Unicode Emoji:**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://api.example.com/api/emoji/emojis" \
|
||||
-H "Content-Type: application/json" \
|
||||
|
@ -251,6 +252,7 @@ curl -X POST "https://api.example.com/api/emoji/emojis" \
|
|||
```
|
||||
|
||||
**Custom Image Emoji:**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://api.example.com/api/emoji/emojis" \
|
||||
-H "Content-Type: application/json" \
|
||||
|
@ -265,6 +267,7 @@ curl -X POST "https://api.example.com/api/emoji/emojis" \
|
|||
```
|
||||
|
||||
**CSS Sprite Emoji:**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://api.example.com/api/emoji/emojis" \
|
||||
-H "Content-Type: application/json" \
|
||||
|
@ -387,7 +390,7 @@ curl -X DELETE "https://api.example.com/api/emoji/emojis/25" \
|
|||
|
||||
#### Example Response
|
||||
|
||||
```
|
||||
```text
|
||||
HTTP/1.1 204 No Content
|
||||
```
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ Welcome to the API documentation. This section covers all available REST API end
|
|||
|
||||
All API endpoints are prefixed with `/api/` and use the following base URL:
|
||||
|
||||
```
|
||||
```http
|
||||
https://your-domain.com/api/
|
||||
```
|
||||
|
||||
|
@ -34,7 +34,7 @@ curl -X POST https://your-domain.com/api/login \
|
|||
|
||||
Include the token in the Authorization header:
|
||||
|
||||
```bash
|
||||
```text
|
||||
Authorization: Bearer your-token-here
|
||||
```
|
||||
|
||||
|
@ -43,6 +43,7 @@ Authorization: Bearer your-token-here
|
|||
All API responses follow a consistent JSON format:
|
||||
|
||||
### Success Response
|
||||
|
||||
```json
|
||||
{
|
||||
"data": {
|
||||
|
@ -53,6 +54,7 @@ All API responses follow a consistent JSON format:
|
|||
```
|
||||
|
||||
### Collection Response
|
||||
|
||||
```json
|
||||
{
|
||||
"data": [
|
||||
|
@ -80,6 +82,7 @@ All API responses follow a consistent JSON format:
|
|||
```
|
||||
|
||||
### Error Response
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "Validation failed",
|
||||
|
@ -112,7 +115,7 @@ API requests are rate-limited to prevent abuse:
|
|||
|
||||
Rate limit headers are included in responses:
|
||||
|
||||
```
|
||||
```text
|
||||
X-RateLimit-Limit: 60
|
||||
X-RateLimit-Remaining: 59
|
||||
X-RateLimit-Reset: 1640995200
|
||||
|
@ -126,7 +129,8 @@ List endpoints support pagination using query parameters:
|
|||
- `per_page` - Items per page (default: 50, max: 100)
|
||||
|
||||
Example:
|
||||
```
|
||||
|
||||
```http
|
||||
GET /api/emoji/emojis?page=2&per_page=25
|
||||
```
|
||||
|
||||
|
@ -148,7 +152,8 @@ Use these parameters to include related data:
|
|||
- `with_emoji` - Include emoji information (for aliases)
|
||||
|
||||
Example:
|
||||
```
|
||||
|
||||
```http
|
||||
GET /api/emoji/emojis?search=smile&with_category=1&with_aliases=1
|
||||
```
|
||||
|
||||
|
@ -156,7 +161,7 @@ GET /api/emoji/emojis?search=smile&with_category=1&with_aliases=1
|
|||
|
||||
The current API version is v1. Future versions will be available at:
|
||||
|
||||
```
|
||||
```http
|
||||
/api/v2/endpoint
|
||||
```
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ const config: Config = {
|
|||
docs: {
|
||||
sidebarPath: './sidebars.ts',
|
||||
editUrl: 'https://github.com/torrentpier/torrentpier/tree/dexter/docs/',
|
||||
exclude: ['api/**'], // Exclude API folder from main docs
|
||||
},
|
||||
blog: {
|
||||
showReadingTime: true,
|
||||
|
@ -54,24 +53,7 @@ const config: Config = {
|
|||
],
|
||||
],
|
||||
|
||||
plugins: [
|
||||
[
|
||||
'@docusaurus/plugin-content-docs',
|
||||
{
|
||||
id: 'api',
|
||||
path: 'docs/api',
|
||||
routeBasePath: 'api',
|
||||
sidebarPath: './sidebars.ts',
|
||||
editUrl: 'https://github.com/torrentpier/torrentpier/tree/dexter/docs/',
|
||||
beforeDefaultRemarkPlugins: [],
|
||||
beforeDefaultRehypePlugins: [],
|
||||
remarkPlugins: [],
|
||||
rehypePlugins: [],
|
||||
showLastUpdateTime: true,
|
||||
showLastUpdateAuthor: true,
|
||||
} satisfies import('@docusaurus/plugin-content-docs').Options,
|
||||
],
|
||||
],
|
||||
plugins: [],
|
||||
|
||||
themeConfig: {
|
||||
image: 'img/social-card.jpg',
|
||||
|
@ -92,7 +74,6 @@ const config: Config = {
|
|||
{
|
||||
type: 'docSidebar',
|
||||
sidebarId: 'apiSidebar',
|
||||
docsPluginId: 'api',
|
||||
position: 'left',
|
||||
label: 'API',
|
||||
},
|
||||
|
@ -115,7 +96,7 @@ const config: Config = {
|
|||
},
|
||||
{
|
||||
label: 'API Reference',
|
||||
to: '/api/overview',
|
||||
to: '/docs/api/overview',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
@ -13,9 +13,49 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
|
|||
Create as many sidebars as you want.
|
||||
*/
|
||||
const sidebars: SidebarsConfig = {
|
||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
||||
docsSidebar: [{type: 'autogenerated', dirName: '.'}],
|
||||
apiSidebar: [{type: 'autogenerated', dirName: '.'}],
|
||||
// Documentation sidebar - manually exclude API by listing other folders
|
||||
docsSidebar: [
|
||||
'intro',
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Getting Started',
|
||||
items: [{type: 'autogenerated', dirName: 'getting-started'}],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Development',
|
||||
items: [{type: 'autogenerated', dirName: 'development'}],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Architecture',
|
||||
items: [{type: 'autogenerated', dirName: 'architecture'}],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Models',
|
||||
items: [{type: 'autogenerated', dirName: 'models'}],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Migration',
|
||||
items: [{type: 'autogenerated', dirName: 'migration'}],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Legacy Documentation',
|
||||
items: [{type: 'autogenerated', dirName: 'legacy'}],
|
||||
},
|
||||
'contributing',
|
||||
],
|
||||
|
||||
// API sidebar - only includes the API folder
|
||||
apiSidebar: [
|
||||
{
|
||||
type: 'autogenerated',
|
||||
dirName: 'api',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default sidebars;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue