Skip to content

Commit 9a1e502

Browse files
committed
chore: remove the doc
1 parent d7badf4 commit 9a1e502

File tree

2 files changed

+0
-60
lines changed
  • packages/document/docs
    • en/guides/basic-features/render
    • zh/guides/basic-features/render

2 files changed

+0
-60
lines changed

packages/document/docs/en/guides/basic-features/render/ssg.mdx

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -93,36 +93,6 @@ Each route in **conventional routing** will generate a separate HTML file. Check
9393
9494
After running `pnpm run serve` to start the project, inspect the returned document in the Network tab of the browser's development tools. The document includes the fully rendered content from the component.
9595
96-
### Preventing Default Behavior
97-
98-
By default, all routes in **conventional routing** have SSG enabled. Modern.js provides another field to prevent the default SSG behavior.
99-
100-
For example, in the following directory structure, routes `/`, `/user`, and `/user/profile` all have SSG enabled:
101-
102-
```bash
103-
.
104-
├── src
105-
│ └── routes
106-
│ ├── layout.tsx
107-
│ ├── page.tsx
108-
│ └── user
109-
│ ├── layout.tsx
110-
│ ├── page.tsx
111-
│ └── profile
112-
│ └── page.tsx
113-
```
114-
115-
You can disable the default behavior of certain routes by configuring `preventDefault`. After configuring as shown below, only the SSG pages for `/` and `/user/profile` will be generated:
116-
117-
```js
118-
export default defineConfig({
119-
output: {
120-
ssg: {
121-
preventDefault: ['/user'],
122-
},
123-
},
124-
});
125-
```
12696
12797
## Using SSG in Manual Routing
12898

packages/document/docs/zh/guides/basic-features/render/ssg.mdx

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -94,36 +94,6 @@ export default () => {
9494
9595
执行 `pnpm run serve` 启动项目后,访问页面,在浏览器我们工具的 Network 窗口,查看请求返回的文档,文档包含组件渲染后的完整页面内容。
9696
97-
### 阻止默认行为
98-
99-
默认情况下,**约定式路由**的路由会全部开启 SSG。Modern.js 提供了另一个字段,用来阻止默认的 SSG 行为。
100-
101-
例如以下目录结构,`/``/user``/user/profle` 三条路由都开启 SSG:
102-
103-
```bash
104-
.
105-
├── src
106-
│ └── routes
107-
│ ├── layout.tsx
108-
│ ├── page.tsx
109-
│ └── user
110-
│ ├── layout.tsx
111-
│ ├── page.tsx
112-
│ └── profile
113-
│ └── page.tsx
114-
```
115-
116-
可以通过配置 `preventDefault` 来禁用某些路由的默认行为。进行下面配置后,最终只会生成 `/``/user/profle` 两条路由的 SSG 页面:
117-
118-
```js
119-
export default defineConfig({
120-
output: {
121-
ssg: {
122-
preventDefault: ['/user'],
123-
},
124-
},
125-
});
126-
```
12797
12898
## 在自控式路由中使用
12999

0 commit comments

Comments
 (0)