Skip to content

Commit 4469196

Browse files
feat: Rspress Documentation Site (#48)
* feat: integrate rspeedy * docs: update home and auto overview * docs: remove typedoc api docs * docs: add social links and improve sidebar labels * docs: remove hello placeholder * ci: deploy docs to gh-pages * ci: fix pnpm setup for gh-pages deploy * ci: use pnpm version from packageManager * feat: upgrade to Rspress 2.0 * fix: fix gh pages build script * chore: change deploy trigger to main branch * chore: changeset
1 parent eda7116 commit 4469196

17 files changed

Lines changed: 6395 additions & 466 deletions

.changeset/rich-bees-arrive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@lynx-js/react-use": minor
3+
---
4+
5+
integrate rspress
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Docs (GitHub Pages)
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 15
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v5
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: "22"
28+
cache: "pnpm"
29+
30+
- name: Install dependencies
31+
run: pnpm install
32+
33+
- name: Configure git user
34+
run: |
35+
git config user.name "github-actions[bot]"
36+
git config user.email "github-actions[bot]@users.noreply.github.com"
37+
38+
- name: Build docs
39+
env:
40+
RSPRESS_SITE_BASE: /${{ github.event.repository.name }}/
41+
run: pnpm docs:build
42+
43+
- name: Deploy to GitHub Pages
44+
uses: peaceiris/actions-gh-pages@v4
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
publish_dir: doc_build
48+
publish_branch: gh-pages
49+
enable_jekyll: false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ storybook-static
1212
.vscode/*
1313
!.vscode/extensions.json
1414
.idea
15+
.trae
1516

1617
# Rspress
1718
doc_build
19+
.rspress

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ pnpm test
3030

3131
### Docs
3232

33-
The documentation site is powered by [rspress](https://rspress.rs/)
33+
The documentation site is powered by [Rspress 2](https://rspress.rs/)
3434

3535
```bash
36-
cd website
37-
pnpm dev
36+
pnpm docs:dev
3837
```
3938

4039
## Contributing

CONTRIBUTING.zh-CN.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ pnpm test
3030

3131
## 文档
3232

33-
文档站点由 [rspress](https://rspress.rs/) 驱动
33+
文档站点由 [Rspress 2](https://rspress.rs/) 驱动
3434

3535
```bash
36-
cd website
37-
pnpm dev
36+
pnpm docs:dev
3837
```
3938

4039
## 贡献

docs/contributing.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Contributing
3+
---
4+
5+
import Contributing from '/CONTRIBUTING.md';
6+
7+
<Contributing components={{ h1: () => null }} />

docs/en/guide.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Guide
3+
overview: true
4+
overviewHeaders: [2]
5+
---
6+
7+
This page has been replaced by the new overview page: [/overview](/overview).

docs/en/index.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
pageType: home
3+
4+
hero:
5+
name: ReactLynx Use
6+
text: A React-style hooks library for ReactLynx
7+
tagline: Powerful, easy-to-use hooks for your ReactLynx applications.
8+
actions:
9+
- theme: brand
10+
text: Get Started
11+
link: /overview
12+
- theme: alt
13+
text: GitHub
14+
link: https://github.com/lynx-community/reactlynx-use
15+
features:
16+
- title: 'ReactLynx Compatible'
17+
details: Seamlessly integrates with ReactLynx applications
18+
icon: 🎯
19+
- title: 'React-Style API'
20+
details: Familiar hooks interface for React developers
21+
icon: ⚛️
22+
- title: 'Cross-Platform'
23+
details: Built with Lynx's unique cross-platform capabilities in mind
24+
icon:
25+
---

docs/en/overview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Overview
3+
overview: true
4+
overviewHeaders: [2]
5+
---
6+
7+
This page is auto-generated from the docs sidebar. Add a new `.md` file under `docs/en` and it will appear here automatically.

docs/zh/contributing.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: 贡献指南
3+
---
4+
5+
import ContributingZh from '/CONTRIBUTING.zh-CN.md';
6+
7+
<ContributingZh components={{ h1: () => null }} />

0 commit comments

Comments
 (0)