Skip to content

Commit 832800f

Browse files
committed
feat: build yew.rs website with Yew (#2779)
Replace the Docusaurus-based website with a pure Rust/Yew implementation using static site generation (SSG). The SSG pipeline compiles each page to WASM, runs wasm-bindgen and wasm-opt, then captures SSR output for SEO-friendly HTML. All docs (5 versions x 4 languages), blog posts, community pages, search, and 404 are generated as static files. Key features: - Content model with dual HTML/Markdown rendering and copy-as-markdown - Syntax highlighting via syntect with light/dark themes - Collapsible sidebar, table of contents, breadcrumbs, and pagination - 3-state theme toggle (light/dark/system) - Blog with date-prefixed URLs, index, sidebar, RSS and Atom feeds - Full-page Algolia search with version faceting - OpenSearch descriptor, sitemap, robots.txt, 404 page - SEO: hreflang, OG tags, JSON-LD breadcrumbs, canonical URLs - CI workflow builds with Rust toolchain instead of Node.js
1 parent acd2a33 commit 832800f

2,843 files changed

Lines changed: 161771 additions & 87 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.

.github/workflows/build-website.yml

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ on:
33
pull_request:
44
branches: [master]
55
paths:
6-
- "website/**"
7-
- "firebase.json"
6+
- "yew-rs/**"
7+
- "website/static/**"
8+
- "Cargo.toml"
9+
- "Cargo.lock"
810
- ".github/workflows/*-website.yml"
911
push:
1012
branches: [master]
1113
paths:
12-
- "website/**"
13-
- "firebase.json"
14+
- "yew-rs/**"
15+
- "website/static/**"
16+
- "Cargo.toml"
17+
- "Cargo.lock"
1418
- ".github/workflows/*-website.yml"
1519

1620
jobs:
@@ -20,40 +24,29 @@ jobs:
2024
steps:
2125
- uses: actions/checkout@v6
2226

23-
- name: Setup node
24-
uses: actions/setup-node@v6
27+
- name: Setup toolchain
28+
uses: dtolnay/rust-toolchain@master
2529
with:
26-
node-version: "lts/Jod"
27-
package-manager-cache: false
30+
toolchain: stable
31+
targets: wasm32-unknown-unknown
2832

29-
- name: Install dependencies
30-
run: |
31-
cd website
32-
npm ci
33-
34-
- name: Run prettier
35-
id: fmt
36-
continue-on-error: true
37-
run: |
38-
cd website
39-
npm run fmt
33+
- uses: Swatinem/rust-cache@v2
34+
with:
35+
save-if: ${{ github.ref == 'refs/heads/master' }}
4036

41-
- if: steps.fmt.outcome == 'failure'
42-
run: |
43-
cd website
44-
npm run fmt:write
45-
git diff
46-
exit 1
37+
- name: Install wasm-bindgen-cli
38+
shell: bash
39+
run: ./ci/install-wasm-bindgen-cli.sh
4740

48-
- name: Check Translations
41+
- name: Install binaryen (latest)
4942
run: |
50-
cd website
51-
npm run check-translations
43+
BINARYEN_URL=$(curl -s https://api.github.com/repos/WebAssembly/binaryen/releases/latest \
44+
| grep -o 'https://[^"]*x86_64-linux.tar.gz')
45+
curl -sL "$BINARYEN_URL" | tar xz
46+
sudo install binaryen-*/bin/wasm-opt /usr/local/bin/
5247
53-
- name: Build
54-
run: |
55-
cd website
56-
npm run build
48+
- name: Build site
49+
run: cargo run --release -p yew-site-ssg
5750

5851
- name: Upload build artifact
5952
uses: actions/upload-artifact@v7

0 commit comments

Comments
 (0)