-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ed01b8c
Showing
8 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
jobs: | ||
build: | ||
name: Feishu Pages Export | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Exporting | ||
env: | ||
FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }} | ||
FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }} | ||
FEISHU_SPACE_ID: '7288219896826494980' | ||
OUTPUT_DIR: ./dist | ||
uses: longbridgeapp/feishu-pages@main | ||
- uses: oven-sh/setup-bun@v1 | ||
- name: Build Pages | ||
run: | | ||
cp -r dist/docs ./ | ||
cp dist/docs.json ./ | ||
bun install & bun run build | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: '.vitepress/dist' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.env | ||
dist/ | ||
docs/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { DefaultTheme, defineConfig } from 'vitepress'; | ||
|
||
import docs from '../docs.json'; | ||
|
||
/** | ||
* Convert feishu-pages's docs.json into VitePress's sidebar config | ||
* @param docs from `docs.json` | ||
* @returns | ||
*/ | ||
const convertDocsToSidebars = (docs: any) => { | ||
const sidebars: DefaultTheme.SidebarItem[] = []; | ||
for (const doc of docs) { | ||
let sidebar: DefaultTheme.SidebarItem = { | ||
text: doc.title, | ||
link: '/docs/' + doc.slug, | ||
}; | ||
if (doc.children.length > 0) { | ||
sidebar.items = convertDocsToSidebars(doc.children); | ||
} | ||
sidebars.push(sidebar); | ||
} | ||
|
||
return sidebars; | ||
}; | ||
|
||
const docsSidebar = convertDocsToSidebars(docs); | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: 'Longbridge Whale Docs', | ||
base: '/whale-docs/', | ||
ignoreDeadLinks: true, | ||
cleanUrls: true, | ||
srcExclude: ['SUMMARY.md'], | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [{ text: 'Home', link: '/' }], | ||
|
||
sidebar: [ | ||
{ | ||
text: 'Docs', | ||
items: docsSidebar, | ||
}, | ||
], | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/longbridgeapp/whale-docs' }, | ||
], | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import DefaultTheme from 'vitepress/theme'; | ||
import '../../style.scss'; | ||
|
||
export default DefaultTheme; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"scripts": { | ||
"build": "bun feishu-pages build" | ||
}, | ||
"dependencies": { | ||
"feishu-pages": "^0.4.1", | ||
"vitepress": "^1.0.0-rc.22" | ||
} | ||
} |