Skip to content

Commit 0ccfacb

Browse files
committed
feat(docs): migrate bs docs
1 parent bf6fc66 commit 0ccfacb

105 files changed

Lines changed: 5538 additions & 244 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.oxlintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
"packages/frontend/apps/ios/App/**",
5353
"tests/blocksuite/snapshots",
5454
"blocksuite/docs/api/**",
55+
"blocksuite/docs-site/.vitepress/.temp/**",
56+
"blocksuite/docs-site/api/**",
5557
"packages/frontend/admin/src/config.json",
5658
"**/test-docs.json",
5759
"**/test-blocks.json"

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ packages/frontend/apps/android/App/**
3939
packages/frontend/apps/ios/App/**
4040
tests/blocksuite/snapshots
4141
blocksuite/docs/api/**
42+
blocksuite/docs-site/.vitepress/.temp/**
43+
blocksuite/docs-site/api/**
4244
packages/frontend/admin/src/config.json
4345
**/test-docs.json
4446
**/test-blocks.json

Cargo.lock

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blocksuite/docs-site/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vitepress/cache
2+
.vitepress/dist
3+
.vitepress/.temp
4+
api/
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
import container from 'markdown-it-container';
2+
import wasm from 'vite-plugin-wasm';
3+
import { defineConfig } from 'vitepress';
4+
import { renderSandbox } from 'vitepress-plugin-sandpack';
5+
6+
import { components, guide, reference } from './sidebar';
7+
8+
// https://vitepress.dev/reference/site-config
9+
export default defineConfig({
10+
// FIXME: remove dead links
11+
ignoreDeadLinks: true,
12+
13+
title: 'BlockSuite',
14+
description: 'Content Editing Tech Stack for the Web',
15+
vite: {
16+
build: {
17+
target: 'ES2022',
18+
},
19+
plugins: [
20+
wasm(),
21+
{
22+
name: 'redirect-plugin',
23+
configureServer(server) {
24+
server.middlewares.use((req, res, next) => {
25+
if (req.url === '/blocksuite-overview.html') {
26+
res.writeHead(301, { Location: '/guide/overview.html' });
27+
res.end();
28+
} else {
29+
next();
30+
}
31+
});
32+
},
33+
},
34+
],
35+
},
36+
lang: 'en-US',
37+
head: [
38+
[
39+
'link',
40+
{
41+
rel: 'icon',
42+
type: 'image/png',
43+
sizes: '32x32',
44+
href: 'https://raw.githubusercontent.com/toeverything/blocksuite/master/assets/logo.svg',
45+
},
46+
],
47+
['meta', { property: 'twitter:card', content: 'summary_large_image' }],
48+
[
49+
'meta',
50+
{
51+
property: 'twitter:image',
52+
content:
53+
'https://raw.githubusercontent.com/toeverything/blocksuite/master/packages/docs/images/blocksuite-cover.jpg',
54+
},
55+
],
56+
[
57+
'meta',
58+
{
59+
property: 'og:image',
60+
content:
61+
'https://raw.githubusercontent.com/toeverything/blocksuite/master/packages/docs/images/blocksuite-cover.jpg',
62+
},
63+
],
64+
],
65+
themeConfig: {
66+
// https://vitepress.dev/reference/default-theme-config
67+
outline: [2, 3],
68+
69+
nav: [
70+
{
71+
text: 'Components',
72+
link: '/components/overview',
73+
activeMatch: '/components/*',
74+
},
75+
{
76+
text: 'Framework',
77+
link: '/guide/overview',
78+
activeMatch: '/guide/*',
79+
},
80+
{
81+
text: 'Playground',
82+
link: 'https://try-blocksuite.vercel.app/?init',
83+
},
84+
{
85+
text: 'More',
86+
items: [
87+
{ text: 'Blog', link: '/blog/', activeMatch: '/blog/*' },
88+
{
89+
text: 'API',
90+
link: '/api/',
91+
activeMatch: '/api/*',
92+
},
93+
{
94+
text: 'Releases',
95+
link: 'https://github.com/toeverything/blocksuite/releases',
96+
},
97+
],
98+
},
99+
],
100+
101+
sidebar: {
102+
'/guide/': { base: '/', items: guide },
103+
'/api/': { base: '/', items: reference },
104+
'/components/': { base: '/', items: components },
105+
},
106+
107+
socialLinks: [
108+
{ icon: 'github', link: 'https://github.com/toeverything/blocksuite' },
109+
{
110+
icon: {
111+
svg: '<svg role="img" xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path fill="#777777" d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg>',
112+
},
113+
link: 'https://twitter.com/AffineDev',
114+
},
115+
],
116+
117+
footer: {
118+
copyright: 'Copyright © 2022-present Toeverything',
119+
},
120+
121+
search: {
122+
provider: 'local',
123+
},
124+
},
125+
markdown: {
126+
config(md) {
127+
md.use(container, 'code-sandbox', {
128+
render(tokens, idx) {
129+
return renderSandbox(tokens, idx, 'code-sandbox');
130+
},
131+
});
132+
},
133+
},
134+
});

0 commit comments

Comments
 (0)