From d91a96f970bca0ef9c972b29f8cc447be5388251 Mon Sep 17 00:00:00 2001 From: Yonghui Lin Date: Thu, 21 Jul 2022 16:37:44 +0800 Subject: [PATCH] chore: rebuild lumos API docs when building website (#371) * chore: rebuild lumos API docs when building website * chore: rebuild lumos API docs when building website --- typedoc.js | 4 ++-- website/.gitignore | 3 +++ website/docusaurus.config.js | 6 ++++-- website/package.json | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/typedoc.js b/typedoc.js index edd04632f..fbad28ae0 100644 --- a/typedoc.js +++ b/typedoc.js @@ -1,11 +1,11 @@ module.exports = { mode: "modules", - out: "docusaurus/website/static/api", + out: "website/static/api", exclude: [ "**/node_modules/**", "**/tests/**/*", "**/examples/**/*", - "**/docusaurus/**/*", + "**/website/**/*", "**/examples/**/*", ], name: "lumos", diff --git a/website/.gitignore b/website/.gitignore index b2d6de306..9adc01705 100644 --- a/website/.gitignore +++ b/website/.gitignore @@ -18,3 +18,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +# typedoc generated +static/api diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 2da9b4e37..c83edaa92 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -40,7 +40,8 @@ const config = { routeBasePath: "/", // Please change this to your repo. // Remove this to remove the "edit this page" links. - editUrl: "https://github.com/nervosnetwork/lumos/tree/develop/website", + editUrl: + "https://github.com/nervosnetwork/lumos/tree/develop/website", }, theme: { customCss: require.resolve("./src/css/custom.css"), @@ -81,9 +82,10 @@ const config = { }, // { to: "/blog", label: "Blog", position: "left" }, { - href: "https://lumos-website.vercel.app/api/index.html", + href: "/api/", label: "API", position: "left", + target: "_blank", }, { href: "https://github.com/nervosnetwork/lumos", diff --git a/website/package.json b/website/package.json index bb311edf2..151e3d038 100644 --- a/website/package.json +++ b/website/package.json @@ -8,7 +8,7 @@ "scripts": { "docusaurus": "docusaurus", "start": "docusaurus start", - "build-lumos": "cd .. && yarn install && yarn run build && yarn run build-release", + "build-lumos": "cd .. && yarn install && yarn run build && yarn run build-release && yarn run docs", "build": "docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy",