-
Notifications
You must be signed in to change notification settings - Fork 0
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
阮文涛
committed
Oct 10, 2023
1 parent
0a6babc
commit b74609c
Showing
7 changed files
with
1,183 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: | ||
generate-pages: | ||
name: Generate 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: '7288170423552131075' | ||
OUTPUT_DIR: ./dist | ||
uses: longbridgeapp/feishu-pages@main | ||
- name: Build Pages | ||
run: | | ||
cp -r dist/docs ./ | ||
cp dist/docs.json ./ | ||
yarn | ||
yarn 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,3 @@ | ||
.vitepress/dist | ||
.vitepress/cache | ||
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,53 @@ | ||
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 Pro Releases", | ||
description: "Longbridge Pro Releases", | ||
ignoreDeadLinks: true, | ||
cleanUrls: true, | ||
srcExclude: ['SUMMARY.md'], | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
// { text: 'Home', link: '/' }, | ||
// { text: 'Releases', link: '/markdown-examples' }, | ||
{ text: 'GitHub', link: 'https://github.com/longbridgeapp/longbridge-pro-docs' } | ||
], | ||
|
||
sidebar: [ | ||
{ | ||
text: 'All Releases', | ||
items: docsSidebar | ||
} | ||
], | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/longbridgeapp/longbridge-pro-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 @@ | ||
[] |
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,6 @@ | ||
--- | ||
title: 首页 | ||
--- | ||
|
||
# 首页 | ||
|
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,25 @@ | ||
{ | ||
"name": "longbridge-pro-docs", | ||
"description": "", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/longbridgeapp/longbridge-pro-docs.git" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"scripts": { | ||
"dev": "vitepress dev", | ||
"build": "vitepress build", | ||
"preview": "vitepress preview" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/longbridgeapp/longbridge-pro-docs/issues" | ||
}, | ||
"homepage": "https://github.com/longbridgeapp/longbridge-pro-docs#readme", | ||
"dependencies": { | ||
"feishu-pages": "^0.4.1", | ||
"vitepress": "^1.0.0-rc.20" | ||
} | ||
} |
Oops, something went wrong.