Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add steps for building embedded site #46

Merged
merged 4 commits into from
Oct 4, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build static site package
name: Build embedded docsite

env:
NODE_VERSION: 20
Expand All @@ -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
Expand All @@ -22,9 +22,9 @@ 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
Expand Down
42 changes: 24 additions & 18 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -9,7 +11,7 @@ const config: Config = {
url: "https://docs.waveterm.dev/",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
baseUrl,

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down Expand Up @@ -49,7 +51,7 @@ const config: Config = {
],
themes: [
["classic", { customCss: "src/css/custom.css" }],
!process.env.DISABLE_ALGOLIA ? "@docusaurus/theme-search-algolia" : undefined,
!process.env.EMBEDDED ? "@docusaurus/theme-search-algolia" : undefined,
].filter((v) => v),
themeConfig: {
docs: {
Expand Down Expand Up @@ -77,19 +79,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.EMBEDDED
? [
{
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: [
{
Expand Down Expand Up @@ -131,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`,
},
},
{
Expand All @@ -140,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"],
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "EMBEDDED=true run build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
Expand Down