|
1 | | -# Website |
| 1 | +# inclusionAI Website |
2 | 2 |
|
3 | | -This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. |
| 3 | +Official website for [inclusionAI](https://github.com/inclusionAI), built with [Docusaurus 3](https://docusaurus.io/). |
4 | 4 |
|
5 | | -## Installation |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Node.js ≥ 20 |
| 8 | +- [pnpm](https://pnpm.io/) (used as the package manager) |
| 9 | + |
| 10 | +## Quick Start |
6 | 11 |
|
7 | 12 | ```bash |
8 | | -yarn |
| 13 | +pnpm install |
| 14 | +pnpm start |
9 | 15 | ``` |
10 | 16 |
|
11 | | -## Local Development |
| 17 | +`pnpm start` launches a local dev server at `http://localhost:3000` with hot-reload. |
| 18 | + |
| 19 | +## Available Commands |
| 20 | + |
| 21 | +| Command | Description | |
| 22 | +| --------------------------- | --------------------------------------- | |
| 23 | +| `pnpm start` | Start local dev server (English locale) | |
| 24 | +| `pnpm start -- --locale zh` | Start dev server in Chinese locale | |
| 25 | +| `pnpm build` | Production build (output in `build/`) | |
| 26 | +| `pnpm serve` | Serve the production build locally | |
| 27 | +| `pnpm clear` | Clear Docusaurus cache | |
| 28 | +| `pnpm typecheck` | Run TypeScript type-checking | |
| 29 | +| `pnpm write-translations` | Extract i18n translation strings | |
| 30 | + |
| 31 | +## Adding a Blog Post |
| 32 | + |
| 33 | +### 1. Create the post directory and file |
12 | 34 |
|
13 | | -```bash |
14 | | -yarn start |
| 35 | +``` |
| 36 | +blog/<post-slug>/index.mdx |
15 | 37 | ``` |
16 | 38 |
|
17 | | -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. |
| 39 | +### 2. Add required frontmatter |
18 | 40 |
|
19 | | -## Build |
| 41 | +```yaml |
| 42 | +--- |
| 43 | +title: "Your Post Title" |
| 44 | +date: 2025-01-01 |
| 45 | +authors: [inclusionai] |
| 46 | +tags: [model, release] |
| 47 | +--- |
| 48 | +``` |
20 | 49 |
|
21 | | -```bash |
22 | | -yarn build |
| 50 | +**Frontmatter fields:** |
| 51 | + |
| 52 | +| Field | Required | Description | |
| 53 | +| ----------------- | -------- | ------------------------------------------------- | |
| 54 | +| `title` | Yes | Post title (shown in listings and page `<title>`) | |
| 55 | +| `date` | Yes | Publication date (`YYYY-MM-DD`) | |
| 56 | +| `authors` | Yes | Author key(s) from `blog/authors.yml` | |
| 57 | +| `tags` | No | Tag list for filtering | |
| 58 | +| `draft` | No | Set `true` to hide from build output | |
| 59 | +| `custom_edit_url` | No | Set `null` to hide the "Edit this page" link | |
| 60 | + |
| 61 | +### 3. Add a Chinese translation (optional) |
| 62 | + |
| 63 | +Create the same file at: |
| 64 | + |
| 65 | +``` |
| 66 | +i18n/zh/docusaurus-plugin-content-blog/<post-slug>/index.mdx |
23 | 67 | ``` |
24 | 68 |
|
25 | | -This command generates static content into the `build` directory and can be served using any static contents hosting service. |
| 69 | +The Chinese version needs the same frontmatter; only the body content needs to be translated. |
26 | 70 |
|
27 | | -## Deployment |
| 71 | +### 4. Including assets |
28 | 72 |
|
29 | | -Using SSH: |
| 73 | +Place images and other assets in the same directory as `index.mdx`: |
30 | 74 |
|
31 | | -```bash |
32 | | -USE_SSH=true yarn deploy |
33 | 75 | ``` |
| 76 | +blog/<post-slug>/ |
| 77 | +├── index.mdx |
| 78 | +└── assets/ |
| 79 | + └── figure1.png |
| 80 | +``` |
| 81 | + |
| 82 | +Reference them with a relative path: ``. |
| 83 | + |
| 84 | +## Adding an Author |
| 85 | + |
| 86 | +Edit `blog/authors.yml`: |
| 87 | + |
| 88 | +```yaml |
| 89 | +your-handle: |
| 90 | + name: Your Name |
| 91 | + title: Your Title |
| 92 | + url: https://github.com/your-handle |
| 93 | + image_url: https://github.com/your-handle.png |
| 94 | + email: you@example.com |
| 95 | +``` |
| 96 | +
|
| 97 | +## Math Support |
| 98 | +
|
| 99 | +KaTeX is enabled. Use standard LaTeX syntax: |
| 100 | +
|
| 101 | +- Inline: `$E = mc^2$` |
| 102 | +- Block: `$$\sum_{i=1}^{n} x_i$$` |
34 | 103 |
|
35 | | -Not using SSH: |
| 104 | +## i18n |
| 105 | + |
| 106 | +The site ships with English (`en`, default) and Simplified Chinese (`zh`) locales. |
| 107 | + |
| 108 | +To extract new translation strings after adding content: |
36 | 109 |
|
37 | 110 | ```bash |
38 | | -GIT_USER=<Your GitHub username> yarn deploy |
| 111 | +pnpm write-translations --locale zh |
39 | 112 | ``` |
40 | 113 |
|
41 | | -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
| 114 | +## Deployment |
| 115 | + |
| 116 | +The site is deployed to GitHub Pages via CI. The production build is triggered by pushing to `main`. |
| 117 | + |
| 118 | +To build and preview locally: |
| 119 | + |
| 120 | +```bash |
| 121 | +pnpm build && pnpm serve |
| 122 | +``` |
0 commit comments