|
2 | 2 |
|
3 | 3 | Main Zarr website hosted at https://zarr.dev |
4 | 4 |
|
5 | | -## Building |
| 5 | +## Local development |
6 | 6 |
|
7 | | -### Option 1: Using Pixi (Recommended) |
| 7 | +This site is built with [VitePress](https://vitepress.dev/). Requires Node.js 20+. |
8 | 8 |
|
9 | | -The easiest way to build and serve the site is using [Pixi](https://pixi.sh), which manages all dependencies automatically. |
10 | | - |
11 | | -1. Install Pixi: |
12 | | -```bash |
13 | | -curl -fsSL https://pixi.sh/install.sh | bash |
14 | | -``` |
15 | | - |
16 | | -2. Start the development server: |
17 | 9 | ```bash |
18 | | -pixi run dev |
19 | | -``` |
20 | | - |
21 | | -The site will be available at http://localhost:4000 with live reload enabled. Pixi will automatically install all dependencies on first run. |
22 | | - |
23 | | -Additional commands: |
24 | | -- `pixi run build` - Build the site for production |
25 | | -- `pixi run install` - Install/update Ruby gems (if needed manually) |
26 | | - |
27 | | -### Option 2: Manual Ruby Installation |
28 | | - |
29 | | -To build the webpage manually, you will need a working Ruby installation. |
30 | | - |
31 | | -If you are on Ubuntu and want to install the requirements locally, |
32 | | -follow the steps below as root. Alternatively, see the Dockerfile |
33 | | -for an alternative. |
34 | | - |
35 | | -1. Install `rvm`. |
36 | | - |
| 10 | +npm ci |
| 11 | +npm run docs:dev # dev server at http://localhost:5173/ |
| 12 | +npm run docs:build # production build into .vitepress/dist/ |
| 13 | +npm run docs:preview # preview the production build |
37 | 14 | ``` |
38 | | -gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409b6b1796c275462a1703113804bb82d39dc0e3 7d2baf1cf37b13e2069d6956105bd0e739499bdb && curl -sSL https://get.rvm.io | bash -s stable |
39 | | -``` |
40 | | - |
41 | | -2. Install Ruby |
42 | | -``` |
43 | | -rvm autolibs disable && rvm install ruby 3.4.3 |
44 | | -``` |
45 | | - |
46 | | -Note that if the above fails, you may need to specify the path for the `rvm` command in your system. |
47 | | - |
48 | | -3. Install `bundler` |
49 | 15 |
|
50 | | -``` |
51 | | -gem install bundler |
52 | | -``` |
| 16 | +## Deployment |
53 | 17 |
|
54 | | -4. In the root of the repository, run: |
| 18 | +The site deploys to GitHub Pages via `.github/workflows/deploy.yml` on every push to `main`. The custom domain `zarr.dev` is preserved by `public/CNAME`, which VitePress copies into the build output. |
55 | 19 |
|
56 | | -``` |
57 | | -bundle install |
58 | | -``` |
| 20 | +## Redirects |
59 | 21 |
|
60 | | -5. Build and serve the site locally: |
| 22 | +Site-wide redirects (e.g. `/numcodecs/blosc` → `numcodecs.readthedocs.io`) are defined as a single YAML map at `.vitepress/redirects.yml`. The build hook in `.vitepress/plugins/redirects.ts` generates one static `<from>/index.html` meta-refresh stub per entry into the build output. |
61 | 23 |
|
62 | | -``` |
63 | | -bundle exec jekyll serve |
64 | | -``` |
| 24 | +To add a redirect: append an entry to `.vitepress/redirects.yml` (`/path: target-url`) and rebuild. |
0 commit comments