From c2589567bf1006543539c73d8d8a9ae2d32d226e Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 3 Oct 2024 14:42:23 -0700 Subject: [PATCH 1/4] save --- docusaurus.config.ts | 34 +++++++++++++++++++--------------- package.json | 2 +- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 00d04c4..c1ba928 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -9,7 +9,7 @@ const config: Config = { url: "https://docs.waveterm.dev/", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: "/", + baseUrl: process.env.LOCAL_SITE ? "/docsite/" : "/", // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. @@ -49,7 +49,7 @@ const config: Config = { ], themes: [ ["classic", { customCss: "src/css/custom.css" }], - !process.env.DISABLE_ALGOLIA ? "@docusaurus/theme-search-algolia" : undefined, + !process.env.LOCAL_SITE ? "@docusaurus/theme-search-algolia" : undefined, ].filter((v) => v), themeConfig: { docs: { @@ -77,19 +77,23 @@ const config: Config = { docId: "index", label: "Docs", }, - { - href: "https://discord.gg/zUeP2aAjaP", - position: "right", - className: "header-link-custom custom-icon-discord", - "aria-label": "Discord invite", - }, - { - href: "https://github.com/wavetermdev/waveterm", - position: "right", - className: "header-link-custom custom-icon-github", - "aria-label": "GitHub repository", - }, - ], + !process.env.LOCAL_SITE + ? [ + { + href: "https://discord.gg/zUeP2aAjaP", + position: "right", + className: "header-link-custom custom-icon-discord", + "aria-label": "Discord invite", + }, + { + href: "https://github.com/wavetermdev/waveterm", + position: "right", + className: "header-link-custom custom-icon-github", + "aria-label": "GitHub repository", + }, + ] + : [], + ].flat(), }, metadata: [ { diff --git a/package.json b/package.json index 5b8a27f..a5d98f5 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "docusaurus": "docusaurus", "start": "docusaurus start", "build": "USE_SIMPLE_CSS_MINIFIER=true docusaurus build", - "build-local": "DISABLE_ALGOLIA=true run build", + "build-local": "LOCAL_SITE=true run build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", From fd291c01ccc8679fef0e6b252b98f3ef372661cc Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 3 Oct 2024 18:28:18 -0400 Subject: [PATCH 2/4] Rename local to embedded --- .../{build-static.yml => build-emedded.yml} | 12 ++++++------ docusaurus.config.ts | 6 +++--- package.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) rename .github/workflows/{build-static.yml => build-emedded.yml} (73%) diff --git a/.github/workflows/build-static.yml b/.github/workflows/build-emedded.yml similarity index 73% rename from .github/workflows/build-static.yml rename to .github/workflows/build-emedded.yml index a80de5f..cfd8fec 100644 --- a/.github/workflows/build-static.yml +++ b/.github/workflows/build-emedded.yml @@ -1,4 +1,4 @@ -name: Build static site package +name: Build embedded docsite env: NODE_VERSION: 20 @@ -8,8 +8,8 @@ on: branches: [main] jobs: - build-static: - name: Build static site + build-embedded: + name: Build embedded site runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -22,10 +22,10 @@ jobs: run: | corepack enable yarn install - - name: Build static site + - name: Build embedded site run: DISABLE_ALGOLIA=1 yarn build - - name: Upload static site artifact + - name: Upload embedded site artifact uses: actions/upload-artifact@v4 with: - name: static-site + name: embedded-site path: build diff --git a/docusaurus.config.ts b/docusaurus.config.ts index c1ba928..4ee03f4 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -9,7 +9,7 @@ const config: Config = { url: "https://docs.waveterm.dev/", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: process.env.LOCAL_SITE ? "/docsite/" : "/", + baseUrl: process.env.EMBEDDED ? "/docsite/" : "/", // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. @@ -49,7 +49,7 @@ const config: Config = { ], themes: [ ["classic", { customCss: "src/css/custom.css" }], - !process.env.LOCAL_SITE ? "@docusaurus/theme-search-algolia" : undefined, + !process.env.EMBEDDED ? "@docusaurus/theme-search-algolia" : undefined, ].filter((v) => v), themeConfig: { docs: { @@ -77,7 +77,7 @@ const config: Config = { docId: "index", label: "Docs", }, - !process.env.LOCAL_SITE + !process.env.EMBEDDED ? [ { href: "https://discord.gg/zUeP2aAjaP", diff --git a/package.json b/package.json index a5d98f5..ac97bcb 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "docusaurus": "docusaurus", "start": "docusaurus start", "build": "USE_SIMPLE_CSS_MINIFIER=true docusaurus build", - "build-local": "LOCAL_SITE=true run build", + "build-local": "EMBEDDED=true run build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", From 1382dd80c414d10a24cef17359d36638ff85b8ee Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 3 Oct 2024 18:33:07 -0400 Subject: [PATCH 3/4] update base url for fontawesome links --- docusaurus.config.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 4ee03f4..021b815 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -1,5 +1,7 @@ import type { Config } from "@docusaurus/types"; +const baseUrl = process.env.EMBEDDED ? "/docsite/" : "/"; + const config: Config = { title: "Wave Terminal Documentation", tagline: "Level Up Your Terminal With Graphical Widgets", @@ -9,7 +11,7 @@ const config: Config = { url: "https://docs.waveterm.dev/", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: process.env.EMBEDDED ? "/docsite/" : "/", + baseUrl, // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. @@ -135,7 +137,7 @@ const config: Config = { as: "font", type: "font/woff2", "data-next-font": "size-adjust", - href: "/fontawesome/webfonts/fa-sharp-regular-400.woff2", + href: `${baseUrl}fontawesome/webfonts/fa-sharp-regular-400.woff2`, }, }, { @@ -144,11 +146,11 @@ const config: Config = { rel: "sitemap", type: "application/xml", title: "Sitemap", - href: "/sitemap.xml", + href: `${baseUrl}sitemap.xml`, }, }, ], - stylesheets: ["/fontawesome/css/fontawesome.min.css", "/fontawesome/css/sharp-regular.min.css"], + stylesheets: [`${baseUrl}fontawesome/css/fontawesome.min.css`, `${baseUrl}fontawesome/css/sharp-regular.min.css`], staticDirectories: ["static"], }; From 06bb2028f2ee7d910e67a7595ea64ad928108749 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 3 Oct 2024 16:03:42 -0700 Subject: [PATCH 4/4] Update build-emedded.yml --- .github/workflows/build-emedded.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-emedded.yml b/.github/workflows/build-emedded.yml index cfd8fec..18bc111 100644 --- a/.github/workflows/build-emedded.yml +++ b/.github/workflows/build-emedded.yml @@ -27,5 +27,5 @@ jobs: - name: Upload embedded site artifact uses: actions/upload-artifact@v4 with: - name: embedded-site + name: static-site path: build