Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PROJECT_NAME=api-docs
CLOUDFLARE_ANALYTICS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxx

OPENAPI_DOCS_BLOG_URL=http://${API_DOCS_DOMAIN}:${NGINX_HOST_HTTP_PORT}/blog/openapi.yaml
OPENAPI_DOCS_DAILY_TIPS_URL=http://${API_DOCS_DOMAIN}:${NGINX_HOST_HTTP_PORT}/daily-tips/openapi.yaml

#-----------------------------------------------------------
#----------------------- Runner ---------------------------
Expand Down
3 changes: 2 additions & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type * as Preset from '@docusaurus/preset-classic';
import Navbar from "./src/configs/navbar";
import PrismConfig from "./src/configs/prism";
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
import { CSlantBlogConfig } from "./src/configs/openApiPlugins";
import { CSlantBlogConfig, CSlantDailyTipsConfig } from "./src/configs/openApiPlugins";

require('dotenv').config();
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
Expand Down Expand Up @@ -81,6 +81,7 @@ const config: Config = {
docsPluginId: "classic",
config: {
blog: CSlantBlogConfig satisfies OpenApiPlugin.Options,
dailyTips: CSlantDailyTipsConfig satisfies OpenApiPlugin.Options,
},
},
],
Expand Down
15 changes: 15 additions & 0 deletions gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
stages:
- build

variables:
GIT_STRATEGY: none

build:
stage: build
tags:
- csl2
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- cd $API_DOCS_REPO_PATH
- ./runner.sh a
5 changes: 5 additions & 0 deletions src/configs/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const Navbar = {
position: "left",
to: "/docs/category/blog-api",
},
{
label: "Daily Tips API",
position: "left",
to: "/docs/category/daily-tips-api",
},

{
href: 'https://github.com/cslant',
Expand Down
8 changes: 8 additions & 0 deletions src/configs/openApiPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ export const CSlantBlogConfig = {
groupPathsBy: "tag",
},
};

export const CSlantDailyTipsConfig = {
outputDir: "docs/daily-tips",
specPath: `${process.env.OPENAPI_DOCS_DAILY_TIPS_URL}`,
sidebarOptions: {
groupPathsBy: "tag",
},
};
12 changes: 12 additions & 0 deletions src/configs/openApiSidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ export const OpenApiSidebar: SidebarsConfig = {
slug: '/category/blog-api'
},
items: require('../../docs/blog/sidebar.js')
},
{
type: 'category',
label: 'Daily Tips',
link: {
type: 'generated-index',
title: 'Daily Tips API',
description:
'CSlant Daily Tips API Documentation uses the OpenAPI Specification to provide a detailed reference for all available endpoints, request and response examples, and more.',
slug: '/category/daily-tips-api'
},
items: require('../../docs/daily-tips/sidebar.js')
}
]
};